Hello everyone, I have made a command to remove a row from my "notes" table.
Everything works well, and when I do the command, it sends me a message: u have removed note ID [note id].. and if I enter an invalid note ID it tells that it's invalid. The only problem is that it doesn't remove the note, here's my removing note script:
PHP Code:
forward RemoveNoteFunc(playerid);
public RemoveNoteFunc(playerid)
{
    new
        rows,
        fields;
    cache_get_data(rows, fields, mysql);
    
    if(rows)
    {
        new madeby, thenoteid, query[128];
        madeby = cache_get_row_int(0, 5);
        thenoteid = cache_get_row_int(0, 0);
        if(pInfo[playerid][Admin] < 6 && pInfo[playerid][ID] != madeby) return SendErrorMSG(playerid, "You cannot remove a note unless it's made by you.");        new 
string[128];
        mysql_format(mysql, query, sizeof(query), "DELETE * FROM notes WHERE `ID` = %d", thenoteid);
        mysql_tquery(mysql, query, "", "");
        format(string, sizeof(string), "You have removed note ID %d.", thenoteid);
        SendAdminMSG(playerid, string);
        format(string, sizeof(string), "%s(%d) has removed note ID %d.", PlayerName(playerid), playerid, thenoteid);
        SendALogMSG(string);
    }
    else
    {
         SendErrorMSG(playerid, "Invalid note ID.");
    }
    return 1;
} 
 
Aucun commentaire:
Enregistrer un commentaire