SA-MP Forums Archive
mysql error - 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 error (/showthread.php?tid=309076)



mysql error - jaskiller - 06.01.2012

hi I want know where is the error in the delete zone :

PHP код:
if(time == 0)
            {
                
format(querysizeof(query), "DELETE FROM time WHERE id = %d ",);
                
mysql_query(query);
                continue;
            }
            
format(querysizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1i);
            
mysql_query(query); 
PHP код:
public CountTimeBan()
{
    new 
query[129], time;
    for (new 
1100 i++)
    {
        
format(querysizeof(query), "SELECT time FROM banlist WHERE id = %d",i);
        
mysql_query(query);
        
mysql_store_result();
        
time mysql_fetch_int();
        if (
mysql_num_rows() !=0)
        {
            if(
time == 0)
            {
                
format(querysizeof(query), "DELETE FROM time WHERE id = %d ",);
                
mysql_query(query);
                continue;
            }
            
format(querysizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1i);
            
mysql_query(query);
        }
        else
        {
            
mysql_free_result();
            continue;
        }
    }
    return 
1;




Re: mysql error - FuTuяe - 06.01.2012

remove continue;

continue is used like this:

if(!isPlayerConnected(playerid)) continue;
Meaning it skips that playerid and goes to the next one.


Re : mysql error - jaskiller - 06.01.2012

wich continues I must del??


Re: mysql error - FuTuяe - 06.01.2012

Every continue; in your post.


Re : mysql error - jaskiller - 06.01.2012

there is new count But the row dosen't be deleted // sorry for bad english

PHP код:
    SetTimer("CountTimeBan"10000true); 
PHP код:
    public CountTimeBan()
{
    new 
query[129], time;
    for (new 
1100 i++)
    {
        
format(querysizeof(query), "SELECT time FROM banlist WHERE id = %d",i);
        
mysql_query(query);
        
mysql_store_result();
        
time mysql_fetch_int();
        if (
mysql_num_rows() !=0)
        {
            if(
time == 0)
            {
                
format(querysizeof(query), "DELETE FROM time WHERE id = %d ",);
                
mysql_query(query);
            }
            else
            {
                
format(querysizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1i);
                
mysql_query(query);
            }
        }
        
mysql_free_result();
    }
    return 
1;




Re : mysql error - jaskiller - 06.01.2012

its ok thx