Syntax errors. - 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: Syntax errors. (
/showthread.php?tid=606055)
Syntax errors. -
ScIrUsna - 29.04.2016
Hi,
Sometimes i get syntax error mysql.log, i save player messages /pm what write to other player and i always escaping it, how possible to get syntax error what message player should write that i could get syntax error?
I do like that:
Код:
update table set msg1='%s',msg2='%s' and so on... WHERE name='%s'", ... );
Everything is ok query is completing but how i mention sometimes i get syntax error when message is incorrent how i gues.
Re: Syntax errors. -
Unte99 - 29.04.2016
Are you sure the variable that supposed to hold the query is big enough? If it's not big enough, the query will give the syntax error.
Re: Syntax errors. -
jlalt - 29.04.2016
using ' symbol can destroy the query example if I send
You're noob,the query won't get excuted, do a loop / function to auto remove ' and ` from player message in the query .-.
Re: Syntax errors. -
ScIrUsna - 29.04.2016
But i'am using escaping
https://sampwiki.blast.hk/wiki/Escape_codes
It have to escape ' to \' or no?
Re: Syntax errors. -
jlalt - 30.04.2016
Quote:
Originally Posted by ScIrUsna
|
No Escape doing the ' twice lol example if you do:
You're bish!
it will make it: You''re bish
Re: Syntax errors. -
ScIrUsna - 30.04.2016
And how i could safely remove that?