SA-MP Forums Archive
problem delete from table - 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: problem delete from table (/showthread.php?tid=645045)



problem delete from table - None1337 - 18.11.2017

Hello, I have a problem in server_log. I have a timer that every 30 minutes check for logs to delete the old logs, but i get every time this errors:

The table `timeplayed' exist, i don't know why i get the error.
client2146 = my database name

Код:
[17:23:50] Error ID: 1146, Error: Table 'client2146.timeplayed' doesn't exist
[17:23:50] Callback: 
[17:23:50] gQuery: DELETE FROM `timeplayed` WHERE `unixtime` < '1505661830'
[17:23:50] ====================================================================
[17:23:50] ====================================================================
[17:23:50] Error ID: 1146, Error: Table 'client2146.antifraudaraport' doesn't exist
[17:23:50] Callback: 
[17:23:50] gQuery: DELETE FROM `antifraudaraport` WHERE `time` < '1510845830'
[17:23:50] ====================================================================
[17:23:50] ====================================================================
[17:23:50] Error ID: 1146, Error: Table 'client2146.blockedaccounts' doesn't exist
[17:23:50] Callback: 
[17:23:50] gQuery: UPDATE `blockedaccounts` SET `unblock`='0',`key`='',`linkexpire`='0' WHERE `unblock` < '1510586630'
[17:23:50] ====================================================================
[17:23:50] ====================================================================
[17:23:50] Error ID: 1146, Error: Table 'client2146.blockedaccounts' doesn't exist
[17:23:50] Callback: 
[17:23:50] gQuery: UPDATE `blockedaccounts` SET `linkexpire`='0',`key`='' WHERE `linkexpire` < '1510845830'
[17:23:50] ====================================================================
code:
Код:
new test[256];
	mysql_format(SQL, test, sizeof(test), "DELETE FROM `timeplayed` WHERE `unixtime` < '%d'", (gettime() - 86400*60));
	mysql_tquery(SQL, test, "", "");
	mysql_format(SQL, test, sizeof(test), "DELETE FROM `antifraudaraport` WHERE `time` < '%d'", gettime());
	mysql_tquery(SQL, test, "", "");
	mysql_format(SQL, test, sizeof(test), "UPDATE `blockedaccounts` SET `unblock`='0',`key`='',`linkexpire`='0' WHERE `unblock` < '%d'", (gettime() - 86400*3));
	mysql_tquery(SQL, test, "", "");
	mysql_format(SQL, test, sizeof(test), "UPDATE `blockedaccounts` SET `linkexpire`='0',`key`='' WHERE `linkexpire` < '%d'", gettime());
	mysql_tquery(SQL, test, "", "");



Re: problem delete from table - Dayrion - 19.11.2017

As the error message say, these tables doesn't exist in your dataabase.


Re: problem delete from table - None1337 - 19.11.2017

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
As the error message say, these tables doesn't exist in your dataabase.
The table is created

https://i.imgur.com/5RpPFjE.png
https://i.imgur.com/8zILN3t.png


Re: problem delete from table - None1337 - 26.11.2017

bump