mysql_real_escape_string - 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_real_escape_string (
/showthread.php?tid=553343)
mysql_real_escape_string -
Banditukas - 29.12.2014
Код:
It does not escape % and _. These are wildcards in MySQL if combined with LIKE, GRANT, or REVOKE.
It means i have to self check? in what query _ can hurt?
Re: mysql_real_escape_string -
Vince - 29.12.2014
As long as you don't use LIKE, GRANT or REVOKE there's nothing to worry about. GRANT and REVOKE especially are related to permissions and should in most cases be set by the database admin (you) rather than through code.
LIKE can be a bit more cumbersome since that's used to search for something; e.g.: show me all players with a name that starts with Mike.
PHP код:
SELECT name FROM player WHERE name LIKE 'Mike%'