Jump to content

SQL error


BiteeeMe

Recommended Posts

Evening,

I'm having this annoying problem with this SQL code - it's affected a vast amount of my script and if someone could fix this for me, it would be much appreciated. When attempting to execute a command, nothing happens in game of course because a shit load of errors come up, fortunately they all seem to lead to the same problem which means a little fix could result in fixing the whole problem.

The errors:

http://gyazo.com/5ef2f5a59cc709a96eda2576bf9a1215

The code the errors lead too:

  
function escape_string(str) 
    return mysql_escape_string(MySQLConnection, str) 
end 
  

Note: this is all the same line.

  
local insertid = mysql:query_insert_free("INSERT INTO vehicles SET job='" .. mysql:escape_string(job) .. "', model='" .. mysql:escape_string(id) .. "', x='" .. mysql:escape_string(x) .. "', y='" .. mysql:escape_string(y) .. "', z='" .. mysql:escape_string(z) .. "', rotx='" .. mysql:escape_string(rx) .. "', roty='" .. mysql:escape_string(ry) .. "', rotz='" .. mysql:escape_string(rz) .. "', color1='[ 0, 0, 0 ]', color2='[ 0, 0, 0 ]', color3='[ 0, 0, 0 ]', color4='[ 0, 0, 0 ]', faction='-1', owner='-2', plate='" .. mysql:escape_string(plate) .. "', currx='" .. mysql:escape_string(x) .. "', curry='" .. mysql:escape_string(y) .. "', currz='" .. mysql:escape_string(z) .. "', currrx='0', currry='0', currrz='" .. mysql:escape_string(r) .. "', interior='" .. mysql:escape_string(interior) .. "', currinterior='" .. mysql:escape_string(interior) .. "', dimension='" .. mysql:escape_string(dimension) .. "', currdimension='" .. mysql:escape_string(dimension) .. "',variant1="..var1..",variant2="..var2) 
  

Thanks in advance!

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...