06.01.2012, 11:18
hi I want know where is the error in the delete zone :
PHP код:
if(time == 0)
{
format(query, sizeof(query), "DELETE FROM time WHERE id = %d ",i );
mysql_query(query);
continue;
}
format(query, sizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1, i);
mysql_query(query);
PHP код:
public CountTimeBan()
{
new query[129], time;
for (new i = 1; i < 100 ; i++)
{
format(query, sizeof(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(query, sizeof(query), "DELETE FROM time WHERE id = %d ",i );
mysql_query(query);
continue;
}
format(query, sizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1, i);
mysql_query(query);
}
else
{
mysql_free_result();
continue;
}
}
return 1;
}