andreiwow2 Posted May 28, 2017 Share Posted May 28, 2017 (edited) Hey guys, this is my query: local createPPQuery = dbQuery(handler, "INSERT INTO PayPhoneOW VALUES (`PosX`,`PosY`,`PosZ`,`Number`)", x, y, z, phonenumber) dbFree(createPPQuery) The error is "Column count doesn't match value count at row 1" if I add ID infront of PosX and also a value for it infront of 'x' then it will work, but ID is auto increment and I don't want to set any value for it when I insert, what is the workaround? Also 'x', 'y' and 'z' along with the 'phonenumber' doesn't insert anything in the db but if I print them they are okay. Should the query be like this maybe? local createPPQuery = dbQuery(handler, "INSERT INTO `PayPhoneOW` (`PosX`,`PosY`,`PosZ`,`Number`) VALUES (?,?,?,?)", x, y, z, phonenumber) if so, then they should update the wiki and add such an example too because I had to guess it myself... Edited May 28, 2017 by Dutchman101 Fix topic title for section requirements Link to comment
KillaBeatZ Posted May 28, 2017 Share Posted May 28, 2017 (edited) Please paste your full code and if you create a table make this: "CREATE TABLE IF NOT EXISTS 'tablename' (id INT AUTO_INCREMENT PRIMARY KEY ) " Edited May 28, 2017 by KillaBeatZ Link to comment
andreiwow2 Posted May 28, 2017 Author Share Posted May 28, 2017 I fixed it with the second query, that was the issue 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