WASSIm. Posted May 11, 2014 Share Posted May 11, 2014 hi guys i have problem, 3 tables don't created and only groups table created, please help exports["database"]:dbExecZA("CREATE TABLE IF NOT EXISTS groups (ID INTEGER PRIMARY KEY NOT NULL, name TEXT, founder TEXT, info TEXT, bank INT, colour INT, created TEXT)") exports["database"]:dbExecZA("CREATE TABLE IF NOT EXISTS groupMembers (ID INTEGER PRIMARY KEY, group TEXT, name TEXT, account TEXT, rank INT, WL INT, lastOn TEXT, joinedOn TEXT)") exports["database"]:dbExecZA("CREATE TABLE IF NOT EXISTS groupRanks (ID INTEGER PRIMARY KEY, group TEXT, name TEXT, premisson TEXT)") exports["database"]:dbExecZA("CREATE TABLE IF NOT EXISTS groupLogs (ID INTEGER PRIMARY KEY, group TEXT, member TEXT, message TEXT, date TEXT)") Logs: [2014-05-11 16:58:43] Starting group [2014-05-11 16:58:43] WARNING: database\server.lua:16: dbPoll failed; no such table: groupMembers [2014-05-11 16:58:43] WARNING: database\server.lua:16: dbPoll failed; no such table: groupRanks [2014-05-11 16:58:43] ERROR: group\utli.lua:23: bad argument #1 to 'pairs' (table expected, got boolean) [2014-05-11 16:58:43] group restarted successfully [2014-05-11 16:58:43] WARNING: @database\server.lua:45: dbExec failed; (1) near "group": syntax error [2014-05-11 16:58:43] WARNING: @database\server.lua:45: dbExec failed; (1) near "group": syntax error [2014-05-11 16:58:43] WARNING: @database\server.lua:45: dbExec failed; (1) near "group": syntax error Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 I believe that "group" is a reserved word. http://dev.mysql.com/doc/refman/5.0/en/ ... words.html http://www.sqlite.org/lang_keywords.html Link to comment
WASSIm. Posted May 11, 2014 Author Share Posted May 11, 2014 (edited) EDIT solved thank you very much Edited May 11, 2014 by Guest Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 Yes, try renaming it to something like "groupName". Link to comment
WASSIm. Posted May 11, 2014 Author Share Posted May 11, 2014 i have other problem, its returned like empty table exports["ZA-database"]:dbQueryZA("SELECT * FROM groupMembers WHERE 'group' = '"..groupName.."' ORDER BY rank DESC") Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 Well, if you renamed your "group" column to "groupName" in your table syntax, then you must also change "group" to "groupName" in your SELECT query. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now