Problem with MySQL: '
#1

Hello,
I have a problem with the '. This problem appear when I create an area with a name like "Toreno's house."
So [05:14:26] [ERROR] CMySQLQuery::Execute[()] - (error #1064) 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 's house', -750.710449, 899.665955, -635.393555, 995.825134, 100, 2, 3)' at line 1
Then mysql_format isn't working as I thought, so this could have vulnerabilities like a sql injection.
Anyone knows how can I fix this?
Note: I want use the ' anyway in my system.
Reply
#2

Show us the query..
Reply
#3

When you are using mysql_format instead of using "%s" for strings use "%e" so that it escapes it automatically. This should fix the error you are getting for having a ' character in the data.
Reply
#4

Thank you very much Chenko, it works!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)