Jump to content

SQLite Problem! [Solved]


undefined

Recommended Posts

Hi guys. Im work on my save system. But I have a problem.

I get this error:

ERROR: mas\DB\hud_option.lua:29: Database query failed: no such table: hud_option 
ERROR: mas\DB\hud_option.lua:29: attempt to index field '?' (a nil value) 

Here is my DB:(Empty)

VAvgkq.png

And here is my code:

Code Removed 

Help pls... :cry:

Edited by Guest
Link to comment
local query = dbQuery(connectDB, "SELECT hudColor FROM hud_option WHERE account_name=?", tostring(account_name))[1].hudColor -- Line 42 
local result = dbPoll(query, -1) 
if result then 
    return fromJSON(query) 
end 

I'm make this but it's not work! :cry:

ERROR: mas\DB\hud_option.lua:42: attempt to index a userdata value

Link to comment
local query = dbQuery(connectDB, "SELECT hudColor FROM hud_option WHERE account_name=?", tostring(account_name)) 
local result = dbPoll(query, -1) 
if result then 
    return result 
end 

And the close bracket at line 1 is missing.

Where? I can't see. Can you show me?

Nothing in this code, have you tried it?

Link to comment

@Wassim

I already solved this problem. But thank you nevertheless.

Code Removed 

OK. I understand now . Now, return is not work. Look at the line 11

It must say; [ [ true, true, true, true, false, 255, 190, true, true ] ]

But it say; [ [ { "hudOption": false } ] ]

Where is the problem?

Edit:
return dbPoll(dbQuery(connectDB, "SELECT hudOption FROM hud_option WHERE account_name=?", tostring(account_name)), -1)[1].hudOption-- Line 63 

outputChatBox said: [ false ]

Edited by Guest
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...