SA-MP Forums Archive
Mysql delete. - 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 delete. (/showthread.php?tid=281676)



Mysql delete. - budelis - 07.09.2011

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)



Re: Mysql delete. - TheArcher - 07.09.2011

There's not files on MySQL there's tables.


Re: Mysql delete. - Vince - 07.09.2011

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



Re: Mysql delete. - StuffBoy - 07.09.2011

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