MySQL Delete query
#1

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 код:
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;

Reply


Messages In This Thread
MySQL Delete query - by Ahmed21 - 24.07.2016, 10:38
Re: MySQL Delete query - by Konstantinos - 24.07.2016, 10:44
Re: MySQL Delete query - by Ahmed21 - 24.07.2016, 10:55
Re: MySQL Delete query - by Konstantinos - 24.07.2016, 10:56
Re: MySQL Delete query - by Ahmed21 - 24.07.2016, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)