Jump to content

SQL Problem


Recommended Posts

There is an error here in the debug script : Database query failed: No such column: false

Attempt to the length of local 'gname' (a boolean value)

The database "Government_members" exists and so does "govName"

  
local nam = getAccountName(getPlayerAccount(player)) 
local gname = executeSQLQuery("SELECT govName FROM Government_members WHERE name = ?", nam) 
if #gname >= 1 then 
  

Link to comment

Well this is what i use for my spawn system and it works fine;

  
            local teams = executeSQLQuery("SELECT team FROM Spawn WHERE name = ? AND city = ?",tostring(spawn), tostring( location )) 
  

Ill test the one you put Crystal and get back.

Link to comment

Oh, if that works fine, that means the function puts the quotes automatically. But the problem in your script probably comes from getAccountName return value. From the error you wrote, it seems to return false, so the quotes aren't put around it, unlike strings. You need to check what it returns before executing the query.

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