DLmass Posted June 2, 2014 Posted June 2, 2014 Hi guys. I'm kinda stuck at this little thing underneath this line. It just won't insert into accounts table. dbQuery( connection, "INSERT INTO accounts (username,password,money,skin,posx,posy,posz,rot,int,dim,health,armor) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)", username, sha256, 2000, math.random(7,288), 1653.67, -1657.99, 22.51, 178, 0, 0, 100, 100) Please help me with this! kind regards, DLmass
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 no error? "just doesn't work"? fyi, if yo on mac: cmd+space to open spotlight type Terminal press enter # THIS LINE HERE MAY BE WRONG. IF YOU TYPE "ls" IT WILL LIST THE DIRECTORY CONTENTS # YOU CAN TYPE "cd" repeatedly instead of all at once type: "cd /Applications/Multi Theft Auto.app/Contents/Resources/drive_c/Program\ Files/MTA\ San\ Andreas\ 1.3/" # THIS SETS PERMISSIONS FOR ALL CONTENTS OF THE CURRENT FOLDER (cd = change directory) type: "chmod 777 -R ./" the mta dir may be wrong.
DLmass Posted June 2, 2014 Author Posted June 2, 2014 No error, theres nothing showing up. So yeah I'm confused.. btw, it's on linux debian! But if I use this it works like a charm! dbQuery( connection, "INSERT INTO accounts (username,password) VALUES(?,?)", username, sha256)
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 okay just navigate to your deathmatch folder try "chmod 755 internal.db" and if it still doesnt work try 777
DLmass Posted June 2, 2014 Author Posted June 2, 2014 it's connected to mysql. I don't use sql anymore..
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 check if it works with an external mysql client
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 type /debugdb 2 for verbose info https://wiki.multitheftauto.com/wiki/Se ... ds#debugdb
DLmass Posted June 2, 2014 Author Posted June 2, 2014 [17:07:36] WARNING: @[gamemode]/accounts/login_server.lua:96: dbExec failed; (10 64) You have an error in your SQL syntax; check the manual that corresponds to y our MySQL server version for the right syntax to use near 'int, dim, health, arm or) VALUES ('d', '3F39D5C348E5B79D06E842C114E6CC571583BBF44' at line 1 I got this error
xXMADEXx Posted June 2, 2014 Posted June 2, 2014 I think it's because those are invalid columns in the MySQL table.
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 fyi in phpmyadmin if you do an insert, it'll show you the generated sql after you press okay (before you press CONFIRM)
DLmass Posted June 2, 2014 Author Posted June 2, 2014 I've noticed something. If I use under VALUES 10 it works but over VALUES 10 it fails This works dbExec( connection, "INSERT INTO accounts (username,password,health,armor,skin,money,posx,posy,posz,rot) VALUES (?,?,?,?,?,?,?,?,?,?)", username,sha256,health,armor,skin,money,posx,posy,posz,rot) This didn't work dbQuery( connection, "INSERT INTO accounts (username,password,money,skin,posx,posy,posz,rot,int,dim,health,armor) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)", username, sha256, 2000, math.random(7,288), 1653.67, -1657.99, 22.51, 178, 0, 0, 100, 100) This works dbQuery( connection, "INSERT INTO accounts (username,password) VALUES(?,?)", username, sha256)
MTA Team qaisjp Posted June 2, 2014 MTA Team Posted June 2, 2014 iirc if you're setting them all in order you don't need to state username,password
pa3ck Posted June 3, 2014 Posted June 3, 2014 Use dbExec instead of dbQuery when inserting / updating values, dbQuery is used for retreiving data. Are you sure you have the columns set up correctly?
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