How do you prevent MySQL Injections? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do you prevent MySQL Injections? (
/showthread.php?tid=172406)
How do you prevent MySQL Injections? -
Toni - 30.08.2010
Hi, I am a little confused on how to prevent MySQL injections, in PAWN.
I have tried looking on the MySQL page, but couldn't find it. (If you have a link, please provide).
Could someone tell me how to do it, as an example, maybe OnDialogReponse; with inputtext?
Thanks.
Re: How do you prevent MySQL Injections? -
Danielo - 30.08.2010
I would like to know too.
Re: How do you prevent MySQL Injections? -
Toni - 30.08.2010
Oh Nvm,
@ Danielo, use the function
pawn Код:
mysql_real_escape_string(const str[], dest[]);
Just use it before a mysql_query, where someone enters a text/number etc into the script.