Mysql delete.
#1

Hi all.I want to ask how to delete file from mysql? i try to do it myself like that:

Код:
new IP[ 40 ],Querys[ 140 ];
GetPlayerIp(playerid, IP, sizeof(IP));
format(Querys,sizeof(Querys),"DELETE FROM banlist WHERE IP = %s", IP);
mysql_query(Querys);
And i get error in mysql log file:

Код:
[13:22:15] CMySQLHandler::Query(DELETE FROM `banlist` WHERE IP = 192.168.1.101) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.1.101' at line 1)
Reply
#2

There's not files on MySQL there's tables.
Reply
#3

Literal strings need to be wrapped in single quotes ' at all times!
Код:
DELETE FROM banlist WHERE IP = '%s'
Reply
#4

Everyone can check my tutorial for Mysql help and Vince is right.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)