SA-MP Forums Archive
Sql delete problems! - 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: Sql delete problems! (/showthread.php?tid=288185)



Sql delete problems! - Fj0rtizFredde - 06.10.2011

Hi. I don't know what's wrong with this code.. It just wont delete the row from the database.. I tried to debug the code as much as I can but I can't seem to find the problem. There are no errors or anything like that.. Anyone might have a clue on what's wrong?
pawn Код:
CMD:fdelete(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE60000FF, "You are not a RCON-Admin!");
    if(!isnull(params)) return SendClientMessage(playerid, 0xE60000FF, "USAGE: /Fdelete [{00FF33}ID{E60000}]");
    if(!IsNumeric(params)) return SendClientMessage(playerid, 0xE60000FF, "ERROR: You did not enter a number!");
    if(!IsVaildDBId(strval(params))) return SendClientMessage(playerid, 0xE60000FF, "ERROR: That ID was not found in the database");
    new query[128];
    format(query, sizeof(query), "DELETE FROM `System` WHERE `ID` = '%d'",strval(params));
    db_query(GPDB,query);
    return 1;
}



Re: Sql delete problems! - Coudio - 06.10.2011

PHP код:
format(querysizeof(query),  "DELETE FROM `System` WHERE `ID` = %i LIMIT 1"strval(params));