SA-MP Forums Archive
MySQL little problem. - 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 little problem. (/showthread.php?tid=397851)



MySQL little problem. - fordawinzz - 07.12.2012

I have this query:
pawn Код:
SELECT Name,Pn FROM `players` WHERE Name LIKE '%s%' AND Pn!=0
To select the name and the phone number from a part of name. The query executes but it won't give me results. What's wrong?


Re: MySQL little problem. - ikkentim - 07.12.2012

if you use the format() function:
replace '%s%'
width '%%%s%%'

edit:
This query you use is insecure.

For example my name is Tim
Someone else is called timmy
This query will return both results.
For this purpose, don't use LIKE