MySQL error:Unknown table 'users' in field list - 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 error:Unknown table 'users' in field list (
/showthread.php?tid=474417)
MySQL error:Unknown table 'users' in field list -
nickdodd25 - 08.11.2013
Hi there,
I have been changing up my database a bit for future things that i have planned and i am now hung up on one strange error that i have yet to figure out.
The error is...
Код:
ERROR: id:1109 error: Unknown table 'users' in field list query: SELECT users.u_id,users.user,playerinfo.pass,playerinfo.vipdays,playerinfo.adminlvl,playe
Thats my debug print under onqueryerror and this is in the mysql log....
Код:
[21:48:08] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[21:48:09] [DEBUG] mysql_tquery - connection handle: 1
[21:48:09] [ERROR] ExecuteT[OnAccountCheck(d)] - (error #1109) Unknown table 'users' in field list
[21:48:09] [DEBUG] ExecuteT[OnAccountCheck(d)] - error will be triggered in OnQueryError
[21:48:09] [DEBUG] Calling callback "OnQueryError"..
And below is the code...
pawn Код:
stock CheckAccount(playerid)
{
new query[90];
format(query, sizeof(query), "SELECT users.u_id,users.user,playerinfo.pass,playerinfo.vipdays,playerinfo.adminlvl,playerinfo.viplevel,playerinfo.vipskin FROM users INNER JOIN playerinfo ON users.u_id = playerinfo.id WHERE users.user = '%s' LIMIT 1", GetName(playerid));
mysql_function_query(g_Handle, query, true, "OnAccountCheck", "d", playerid);
return 1;
}
Now both databases are there and what really gets me is this query works great in phpmyadmin but throws that error above once i run it in my gamemode. I also load vip info so if the player is a legit registered player thats vip they can join the server with the reserved slots and if they have a vip skin set they can choose to bypass class selection. And staff into for the reserved slots the same as vip. I'm sure how i structured this query is probaly wrong but i'm just learning how to use INNER JOIN....
Any help would be greatly appreciated!
Thanks
EDIT: Fixed the error just overlooked the query string length and it wasn't long enough.