MySQL Query Problem
#1

Hi, I just converted my script to MySQL and i have a little problem with an query.

Error Code:
Код:
[15:46:52] 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 'Name`, `IP`, `Time`, `Reason`, `Date`, 
`Admin`, `Expire`, `Code`} VALUES ('sHapp' at line 1, OnQueryFinish, INSERT INTO `bans_ip (`Name`, 
`IP`, `Time`, `Reason`, `Date`, `Admin`, `Expire`, `Code`} VALUES ('sHapp3z0r', '192.168.0.100', '2', 
'Reclama', '14/11/2012 la 15:46:52', 'Server/Anticheat', '2012/11/16 la 15:46:52', '2012,11,16,15,46,52'), 1
Code:
Код:
format(query, sizeof(query), "INSERT INTO `"#MYSQL_BANSIPTABLE" (`Name`, `IP`, `Time`, `Reason`, 
`Date`, `Admin`, \
	`Expire`, `Code`} VALUES ('%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s')", GetName(playerid), 
PlayerIP(playerid), time, reason2, string, admin, expiredate, expire);
	mysql_query(query, -1, -1, 1);
Witch can be the problem ?
Reply
#2

Quote:

`"#MYSQL_BANSIPTABLE"

here is your problem.
Reply
#3

Код:
#define MYSQL_BANSIPTABLE		"bans_ip"
If were there error it would say somethink like Table wasn't find ...
Reply
#4

Quote:
Originally Posted by shaPP
Посмотреть сообщение
Код:
#define MYSQL_BANSIPTABLE		"bans_ip"
If were there error it would say somethink like Table wasn't find ...
Look at my post again.
Reply
#5

Oh, missed one "`" :"> Trying it now. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)