I'm a bit in trouble having mysqloo to work and figure it out.
Now i'm trying a timer and seems server isn't executing the timer
Can anyone please help me please?
this is my test init.lua
[code]
require("mysqloo")
function connectDB()
SSDB = mysqloo.connect ( "localhost" , "root" , "sylar" , "ss3dgm" , 3306 )
SSDB.onConnected = function()
print ( "mySQL Connection: Success!" )
end
SSDB:connect()
SSDB:wait()
timer.Create("a test", 1, 0, function()
print("hello")
end)
end
function readDB()
query = SSDB:query("SELECT * FROM ss_admins")
query:setOption(mysqloo.OPTION_NUMERIC_FIELDS, true)
query:setOption(mysqloo.OPTION_NAMED_FIELDS, false)
query.onSuccess = function()
print(query:getData())
end
query.onFailure = function(error_message)
print(error_message)
end
query:start()
end
[/code]
when I do connectDB() - it echoes connection success
but after i do readDB() nothing echo's, also the timer isn't getting executed
PS: Had to restart server twice then it kinda worked, hmmm
SSDB:wait()
What does this do? I don't see it in the list of DatabaseObject methods on the mysqloo release page.
[QUOTE=Drakehawke;24479256]SSDB:wait()
What does this do? I don't see it in the list of DatabaseObject methods on the mysqloo release page.[/QUOTE]
Puts connection in sleep mode
[QUOTE=WaterRatj;24479313]Puts connection in sleep mode[/QUOTE]
The connection will automatically sleep if no queries are being sent.
Sorry, you need to Log In to post a reply to this thread.