MySQL Select FROM * Error
#1

Code:
Код:
format(query,sizeof(query),"SELECT * FROM factions WHERE ID = '%d') ",pInfo[playerid][Faction]);
	mysql_function_query(Connection,query,false,"FactionInfo","i",playerid);
Error:
Код:
[14:23:53] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM factions WHERE ID = '38') ", callback: "FactionInfo", format: "i"
[14:23:53] [DEBUG] CMySQLQuery::Execute[FactionInfo] - starting query execution
[14:23:53] [ERROR] CMySQLQuery::Execute[FactionInfo] - (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 ')' at line 1
[14:23:53] [DEBUG] CMySQLQuery::Execute[FactionInfo] - error will be triggered in OnQueryError
Reply
#2

"SELECT * FROM factions WHERE ID = %d"
Reply
#3

Now it is:
Код:
[14:34:39] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM factions WHERE ID = 38) ", callback: "FactionInfo", format: "i"
[14:34:39] [DEBUG] CMySQLQuery::Execute[FactionInfo] - starting query execution
[14:34:39] [ERROR] CMySQLQuery::Execute[FactionInfo] - (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 ')' at line 1
[14:34:39] [DEBUG] CMySQLQuery::Execute[FactionInfo] - error will be triggered in OnQueryError
Reply
#4

Код:
format(query,sizeof(query),"SELECT * FROM factions WHERE ID = %d ",pInfo[playerid][Faction]);
	mysql_function_query(Connection,query,false,"FactionInfo","i",playerid);
Reply
#5

Quote:
Originally Posted by SandKing94
Посмотреть сообщение
Now it is:
Код:
[14:34:39] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM factions WHERE ID = 38) ", callback: "FactionInfo", format: "i"
[14:34:39] [DEBUG] CMySQLQuery::Execute[FactionInfo] - starting query execution
[14:34:39] [ERROR] CMySQLQuery::Execute[FactionInfo] - (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 ')' at line 1
[14:34:39] [DEBUG] CMySQLQuery::Execute[FactionInfo] - error will be triggered in OnQueryError
Re-look what I posted. I haven't used any ) and the parenthesis is what causing the error.
Reply
#6

What is your mysql version ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)