P
P
pro100nepro2019-05-14 20:58:55
SQL
pro100nepro, 2019-05-14 20:58:55

How to create such a query to the database in sql?

In general, you need to execute the following query:

UPDATE dle_post SET xfields = '||iframe2|https://site.ru/h3JunK4x17sJ?title=1?kp_id=(`kp_id_movie`)'

Instead of (`kp_id_movie`), you need to insert data from this (`kp_id_movie`). How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VicTHOR, 2019-05-15
@pro100nepro

If I understood correctly

DECLARE @kp_id integer
    SET @kp_id = (SELECT kp_id_movie FROM dle_post)
UPDATE dle_post
    SET xfields = CONCAT('||iframe2|https://site.ru/h3JunK4x17sJ?title=1?kp_id=', @kp_id)

N
nApoBo3, 2019-05-14
@nApoBo3

Just do it, through the concatenation of strings.
Just be aware that this approach is vulnerable to injections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question