Friday, July 13, 2018

PHP MySQL query problem with string despite using mysql_real_escape_string

The following SQL query:


INSERT INTO `database`.`table` (`param1`, `param2`)
VALUES (
'Новости Томска – подборка новостей из общественной жизни города, политики, спорта, обзор происшествий, событий.\r\nПолезная информация о недвижимости, авто, финансах, работе и консультации специалистов.\r\nОбъявления по различным тематикам, вакансии томских работодателей. \',
'Томский городской портал, Томск, Портал города Томска, Недвижимость в Томске, Авторынок Томска, Продажа авто в Томске, Работа в Томске, Вакансии, Резюме, Отдых в Томске, Афиша Томска, Новости Томска, Томский форум, Погода в Томске, Томские сайты, Каталог томских сайтов, Частны');

failed with error message:



You have an error in your SQL syntax;
check the manual that corresponds to
your MySQL server version for the
right syntax to use near 'Томский
городской портал, Томск, Портал гор'
at line 1



I have used mysql_real_escape_string on the strings before using them on the SQL query, so I thought this was enough to make them error-free.


My database is set to use



utf8_general_ci



as Collation for these fields.


What can be the problem with the query?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...