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(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;
}
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", 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;
}
Re : mysql error -
jaskiller - 06.01.2012
its ok thx