Quote:
Originally Posted by jlalt
try doing dat sir:
PHP код:
mysql_escape_string(name, string);
then
PHP код:
mysql_format(mysql, query, sizeof(query), "SELECT `Username`, `Registration`, `IP`, `Score` FROM `Users` WHERE `Username` LIKE '%%%s%%' LIMIT %d", string, amount);
print(query);
however in your code you was formating string and using name instead of string .-.
Код:
format(string, sizeof(string), "%%%s%%", name);
mysql_format(mysql, query, sizeof(query), "SELECT `Username`, `Registration`, `IP`, `Score` FROM `Users` WHERE `Username` LIKE '%e' LIMIT %d", name, amount);
print(query);
its supposed to be:
PHP код:
format(string, sizeof(string), "%%%s%%", name);
mysql_format(mysql, query, sizeof(query), "SELECT `Username`, `Registration`, `IP`, `Score` FROM `Users` WHERE `Username` LIKE '%e' LIMIT %d", string, amount);
print(query);
|
Works smoothly mate, thank you
BTW, Escaping a string actually makes it longer or shorter ?
P.S Can't rep sorry