SA-MP Forums Archive
why can't i mysql_tquery after the query is escaped?? - 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: why can't i mysql_tquery after the query is escaped?? (/showthread.php?tid=605884)



why can't i mysql_tquery after the query is escaped?? - dodoc - 26.04.2016

i dont understand.. it should work..but cant not function. why? the mysql_log indicates it cant not recognize the escaped string


Re: why can't i mysql_tquery after the query is escaped?? - Sk1lleD - 26.04.2016

Try to escape only the fields not the whole string at once.

I.E
Escaping inputtext from dialog:
Код:
mysql_escape_string(inputtext, inputtext);
new string[128]; format(string, sizeof(string), "UPDATE `table` SET `Field` = '%s' WHERE `Condition` = 1", inputtext);
mysql_tquery(connectionHandle, string, "");
Or use mysql_format with %e specifier
Код:
new string[128]; 
mysql_format(connectionHandle, string, sizeof(string), "UPDATE `table` SET `Field` = '%e' WHERE `Condition` = 1", inputtext);
mysql_tquery(connectionHandle, string, "");



Re: why can't i mysql_tquery after the query is escaped?? - denNorske - 26.04.2016

Quote:
Originally Posted by dodoc
Посмотреть сообщение
i dont understand.. it should work..but cant not function. why? the mysql_log indicates it cant not recognize the escaped string
If you are certain you did what was done above (Sk1lleD's post) you should post code. It makes it easier to help if it's a specific part failing only