Jump to content

Syntax error SQL


roaddog

Recommended Posts

function setTurfOwners() 
    local realTable = sortTable() 
    for i, v in ipairs(realTable) do 
        local r, g, b = exports.AGGroups:getGroupColor ( v[3]) 
        local rE = radar[v[1]] 
        local turfColor = toJSON({r, g, b}) 
        if (rE) then 
            setRadarAreaColor(rE, r, g, b, 200) 
        end 
        if (t_owner[v[1]]) then 
            dbExec(db, "UPDATE theturfs SET owner=?, color=? WHERE name=?", tostring(v[3]), tostring(fromJSON(turfColor)), tostring(v[1])) 
            break 
        else 
            dbExec(db, "INSERT INTO theturfs SET VALUES (?, ?, ?)", tostring(v[1]), tostring(v[3]), tostring(turfColor)) -- Error 
            t_owner[v[1]] = v[3] 
            break 
        end 
        t_owner[v[1]] = v[3] 
    end 
end  

I have got an error at line 14

debug says syntax error near SET (1) something I forgot to take a screen.

Thanks in advance

Link to comment
  
function setTurfOwners() 
    local realTable = sortTable() 
    for i, v in ipairs(realTable) do 
        local r, g, b = exports.AGGroups:getGroupColor ( v[3]) 
        local rE = radar[v[1]] 
        local turfColor = toJSON({r, g, b}) 
        if (rE) then 
            setRadarAreaColor(rE, r, g, b, 200) 
        end 
        if (t_owner[v[1]]) then 
            dbExec(db, "UPDATE theturfs SET owner=?, color=? WHERE name=?", tostring(v[3]), tostring(fromJSON(turfColor)), tostring(v[1])) 
            break 
        else 
            dbExec(db, "INSERT INTO theturfs VALUES (?, ?, ?)", tostring(v[1]), tostring(v[3]), tostring(turfColor)) -- Error 
            t_owner[v[1]] = v[3] 
            break 
        end 
        t_owner[v[1]] = v[3] 
    end 
end 
  

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...