Answer the question
In order to leave comments, you need to log in
Why is a backslash added to a MYSQL query?
I am passing a generated request to the database from an HTML document via ajax. In PHP, I accept it, I get an error
have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `modx_site_tmplvar_contentvalues` SET `value`=\"8912222\" WHERE `id` = \"2\"' at line 1"}
$textQuery = $_POST['query']; // Получил строку
echo $textQuery; // Я получил обратно в HTML то, что и отсылал и это работает если Выполнить SQL-запрос напрямую
mysql_query("SET NAMES utf8");
$result = mysql_query($textQuery); // Выдает ошибку
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question