dimanche 24 juillet 2016

MySQL Delete query

Let's block ads! (Why?)



MySQL Delete query
Old 24/07/2016, 10:38 AM   #1

Little Clucker

 

Join Date: Jul 2016

Posts: 13

Reputation: 0

DefaultMySQL Delete query

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(rowsfieldsmysql);
    
    if(
rows)
    {
        new 
madebythenoteidquery[128];
        
madeby cache_get_row_int(05);
        
thenoteid cache_get_row_int(00);
        if(
pInfo[playerid][Admin] < && pInfo[playerid][ID] != madeby) return SendErrorMSG(playerid"You cannot remove a note unless it's made by you.");

        new 

string[128];
        
mysql_format(mysqlquerysizeof(query), "DELETE * FROM notes WHERE `ID` = %d"thenoteid);
        
mysql_tquery(mysqlquery"""");
        
format(stringsizeof(string), "You have removed note ID %d."thenoteid);
        
SendAdminMSG(playeridstring);
        
format(stringsizeof(string), "%s(%d) has removed note ID %d."PlayerName(playerid), playeridthenoteid);
        
SendALogMSG(string);
    }
    else
    {
         
SendErrorMSG(playerid"Invalid note ID.");
    }
    return 
1;

Ahmed21 is online now   Reply With Quote

Aucun commentaire:

Enregistrer un commentaire