Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
I'am escaping in command end sending querie which calling to callback and there also i do another query. I'am also sending same text to update but it's escaped? if i escape in command and send it with parameter to query that text is escaped too? or i need reescape?
Posts: 801
Threads: 29
Joined: May 2012
Reputation:
0
I don't quite understand what you mean, if you could post some code then that could clarify some points about your question.
Posts: 723
Threads: 366
Joined: Jun 2016
Код:
CMD:Test()
{
new Someshit[ 50 ] = "blbl,'''\;//''"'";
new escapedtext[200];
mysql_escape_string(Someshit, escapedtext);
mysql_tquery(MySQL, query, "OnPlayerDataLoaded", "ds", playerid,escapedtext);
}
forward OnPlayerDataLoaded( playerid, ttext );
public OnPlayerDataLoaded( playerid, ttext )
{
// now if using ttext it's will be escaped like if in command?
mysql_tquery("UPDATE table set row='%s'", ttext );
}
Posts: 801
Threads: 29
Joined: May 2012
Reputation:
0
Concerning your question, yes the "ttext" will be a escaped string on the callback.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
You should simply use mysql_format. Using that you don't ever have to worry about escaping. The original value of the variable is preserved and an escaped version is sent with the query.