mysql_escape_string - destination size is too small (must be at least as big as source) - 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: mysql_escape_string - destination size is too small (must be at least as big as source) (
/showthread.php?tid=600356)
mysql_escape_string - destination size is too small (must be at least as big as source) -
CSCripMa - 07.02.2016
Hi,
I get this error:
mysql_escape_string - destination size is too small (must be at least as big as source)
When this happin? and how know where is mistakes because mysql log don't print it. Is this couse if i do like that?
Код:
new EscapeSmthing[ 100 ];
mysql_real_escape_string(EscapeSmthing,EscapeSmthing);
Re: mysql_escape_string - destination size is too small (must be at least as big as source) -
JohnBlaze1971 - 07.02.2016
For an example :
You do it under zcmd then it will be something like this
Код:
CMD:blah(playerid,params[])
{
new EscapeSmthing[ 100 ];
mysql_real_escape_string(params,EscapeSmthing);
}
On player text then
Код:
new EscapeSmthing[ 100 ];
mysql_real_escape_string(text,EscapeSmthing);
https://sampwiki.blast.hk/wiki/MySQL#mys..._escape_string
Once have a look there , if any doubt don't hesitate to message me. Good day.
Re: mysql_escape_string - destination size is too small (must be at least as big as source) -
CSCripMa - 07.02.2016
Now other question, i have sometimes that there is syntax error in query but it's not always just sometimes, because i safe there text and that text can change players maybe they change to that text what give that syntax error, but i'am escaping it before saving what i have do more or what symbols more i need forbid
Re: mysql_escape_string - destination size is too small (must be at least as big as source) -
JohnBlaze1971 - 07.02.2016
Go more brief and provide the codes. As we may help you in a more liberal way. Good day.
Re: mysql_escape_string - destination size is too small (must be at least as big as source) -
CSCripMa - 07.02.2016
Just simple what text that occur syntax error?
Re: mysql_escape_string - destination size is too small (must be at least as big as source) -
CSCripMa - 07.02.2016
Maybe this symbol '\' can occur syntax error?