mysql error
#1

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;

Reply
#2

remove continue;

continue is used like this:

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

wich continues I must del??
Reply
#4

Every continue; in your post.
Reply
#5

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;

Reply
#6

its ok thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)