Mittell Buurman Posted December 20, 2012 Share Posted December 20, 2012 Hello, I'm currently working on a script that require some data from the SQL. After figuring out how to set up and load the database that was required and connect it to an external database, I could finally start scripting. Now here's the issue: ERROR: call: failed to call 'mysql:query'[string"?"] local factionID = tonumber(getElementData(theTeam, "id")) local vehicleID = exports.mysql:query("SELECT 'id' FROM 'vehicles' WHERE 'faction' = '".. factionID .."'") Link to comment
uhm Posted December 20, 2012 Share Posted December 20, 2012 dont put quotes around tables, for they are not strings also not around column names, for you don't want it to return the string 'id' either like so local factionID = tonumber(getElementData(theTeam, "id")) local vehicleID = exports.mysql:query("SELECT id FROM vehicles WHERE faction= '".. factionID .."'") not sure if this actually fixes it though, that error doesnt imply a syntax error. it should have succeeded at the call, but return nil. is this how exports work? Link to comment
Renkon Posted December 20, 2012 Share Posted December 20, 2012 Make sure, btw, that factionID is a number. Link to comment
Mittell Buurman Posted December 20, 2012 Author Share Posted December 20, 2012 Thanks for the info. Im not sure if it worked either, but it probably would. Figured I added it to the client script, that's why it didn't call it. I'm still learning to script, but It's pretty hard for me. 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