php - MySQL error when inserting data containing apostrophes::
Problem::
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's lynn'' at line 8
select c.* from os_state where c.code = 'GB' and c.name = 'king's lynn'
Solution::
$val = mysql_real_escape_string(trim($val));
Problem::
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's lynn'' at line 8
select c.* from os_state where c.code = 'GB' and c.name = 'king's lynn'
Solution::
$val = mysql_real_escape_string(trim($val));
No comments:
Post a Comment