SA-MP Forums Archive
Question about escaping strings - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about escaping strings (/showthread.php?tid=388225)



Question about escaping strings - CoDeZ - 28.10.2012

Hello, sorry for my annoying questions, but when should i escape strings when using mysql R7?
when i tried to escape a string using " %e " place holder into an INSERT query for a hashed password it inserted " e " into the field...


Re: Question about escaping strings - CoaPsyFactor - 28.10.2012

hmm I can't tell you what problem is, but I can suggest you to use mysql_real_escape_string()


Re: Question about escaping strings - ReneG - 28.10.2012

You can just escape the strings manually by using the back-slash before apostrophes.
pawn Код:
new query[128];

format(query, sizeof(query), "INSERT INTO `table` ('Password') VALUES (\'%s\')", "password123");