H
H
Horosh2942020-10-22 12:20:41
SQL
Horosh294, 2020-10-22 12:20:41

How to fix error when adding SQL to table?

I am running this query in SQL

Update dle_post Set xfields = xfields + "||country1|<a href="/country:Франция/">Франция</a>, <a href="/country:Бельгия/">Бельгия</a>, <a href="/country:Ирландия/">Ирландия</a>, <a href="/country:Нидерланды/">Нидерланды</a>, <a href="/country:США/">США</a>, <a href="/country:Дания/">Дания</a>, <a href="/country:Бразилия/">Бразилия</a>, <a href="/country:Германия/">Германия</a>, <a href="/country:Австрия/">Австрия</a>, <a href="/country:Венгрия/">Венгрия</a>" Where id = "23285";

Gives an error message. Probably the problem is that there are a lot of quotes inside the request, but I don’t know how to do it without them or in another way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-10-22
@Alex_At_Net

Of course a lot. Escape the quotation marks or use other enclosing quotation marks. For example, for MySQL, you can write like this:

Update dle_post Set xfields = xfields + '||cou....'  Where id = '23285';

Quotes can also be escaped with a double quote:
Update dle_post Set xfields = xfields + "||country1|<a href=""/countr..."  Where id = "23285";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question