MySQL - 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 (
/showthread.php?tid=480274)
MySQL -
XSR - 09.12.2013
Hello I have a MySQL problem with ban system. It write in database player banned etc, but when I try to check if it is banned nothing happen. Table was InnoDB and I only changed it to MyISAM only at operation
Код:
stock jBanCheck( playerid )
{
format( jQuery, MAX_QUERY_LENGTH, "SELECT user_banner, ban_reason, TIMESTAMPDIFF(MINUTE, NOW(), DATE_ADD(ban_timestamp, INTERVAL ban_time MINUTE)) FROM `"#J_TABLE"` WHERE user_banned_ip = '%s' AND (NOW() <= DATE_ADD(ban_timestamp, INTERVAL ban_time MINUTE) OR ban_time = 0)", jIP[ playerid ] );
mysql_query_callback( QUERY_CHECKNAME, jQuery, "OnQueryFinish", playerid, jban_connection );
return ( 1 );
}
This is the ban check...
Re: MySQL -
XSR - 10.12.2013
Nobody?...
Re: MySQL -
DarrenReeder - 10.12.2013
Show us the callback code? The OnQueryFinish?
Re: MySQL -
CriticalRP - 10.12.2013
1. Run a query.
2. Save the result using mysql_store_result
3. Check if mysql_num_rows >= 1 then display a msg to the user
4. Free the result using mysql_free_result
Re: MySQL -
XSR - 10.12.2013
I solved, was my error, I did a wrong symbol, thanks.