06.01.2012, 17:18
there is new count But the row dosen't be deleted // sorry for bad english
PHP код:
SetTimer("CountTimeBan", 10000, true);
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);
}
else
{
format(query, sizeof(query), "UPDATE banlist SET time = %d WHERE id = %d",time-1, i);
mysql_query(query);
}
}
mysql_free_result();
}
return 1;
}