MySQL ban help
#1

Hi my friends, how to fix: (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ban_timestamp + (ban_time * 60), 'unixepoch')) as banExpired, strftime('%d-%m-%' at line 1
what is the problem? Before banning player

Then after banning player:
11:36:22 CMySQLQuery::Execute ERROR (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ban_timestamp + (ban_time * 60), 'unixepoch')) as banExpired, strftime('%d-%m-%' at line 1
11:36:22 cache_get_row_count WARNING no active cache
11:36:29 CMySQLQuery::Execute ERROR (error #2006) MySQL server has gone away
11:36:45 CMySQLQuery::Execute ERROR (error #1305) FUNCTION ojk.strftime does not exist
Reply
#2

First of all show the code lines if you want help.
Reply
#3

Code:
Код:
format(gQuery, MAX_QUERY_LENGTH, "SELECT user_banned, ban_reason, ban_time, (ban_timestamp + (ban_time * 60) - strftime('%%s', 'now')) as banTimeLeft, strftime('%%d-%%m-%%Y %%H:%%M', datetime(ban_timestamp + (ban_time * 60), 'unixepoch')) as banExpired, strftime('%%d-%%m-%%Y %%H:%%M', datetime(ban_timestamp, 'unixepoch')) as bannedFrom, user_banner FROM `bans` WHERE user_banned_ip = '%s' OR user_banned = '%s' AND (banTimeLeft > 0 OR ban_time = 0);", getIP(playerid), GetName(playerid));
Reply
#4

put the code between [code [/code
Reply
#5

Код:
format(gQuery, MAX_QUERY_LENGTH, "SELECT user_banned, ban_reason, ban_time, (ban_timestamp + (ban_time * 60) - strftime('%%s', 'now')) as banTimeLeft, strftime('%%d-%%m-%%Y %%H:%%M', datetime(ban_timestamp + (ban_time * 60), 'unixepoch')) as banExpired, strftime('%%d-%%m-%%Y %%H:%%M', datetime(ban_timestamp, 'unixepoch')) as bannedFrom, user_banner FROM `bans` WHERE user_banned_ip = '%s' OR user_banned = '%s' AND (banTimeLeft > 0 OR ban_time = 0);", getIP(playerid), GetName(playerid));
Theres code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)