Hello everybody, I am trying to install mysqloo to my ubuntu vps server but thenever I try writting lua_run require("mysqloo") I get this:
] rcon lua_run require("mysqloo")
autokick is disabled for Fluqsi.
> require ( mysqloo )...
L 06/29/2014 - 21:41:20: Lua Error:
[ERROR] lua_run:1: bad argument #1 to 'require' (string expected, got table)
1. require - [C]:-1
2. unknown - lua_run:1
[ERROR] lua_run:1: bad argument #1 to 'require' (string expected, got table)
1. require - [C]:-1
2. unknown - lua_run:1
Don't use lua_run for this, you are supposed to use it in a file that uses the library.
Well I made a mysqloo.lua file in lua/includes/modules/mysqloo.lua and it contains
[CODE]require( "mysqloo" )
local queue = {}
local db = mysqloo.connect( "my host", "fluqsi", "*************", "fluqsi_donate", 3306 )
function db:onConnected()
for k, v in pairs( queue ) do
query( v[ 1 ], v[ 2 ] )
end
queue = {}
end
function db:onConnectionFailed( err )
print( "Connection to database failed!" )
print( "Error:", err )
end
db:connect()
function query( sql, callback )
local q = db:query( sql )
function q:onSuccess( data )
callback( data )
end
function q:onError( err )
if db:status() == mysqloo.DATABASE_NOT_CONNECTED then
table.insert( queue, { sql, callback } )
db:connect()
return
end
print( "Query Errored, error:", err, " sql: ", sql )
end
q:start()
end[/CODE]
But I still can't get it to work
Sorry, you need to Log In to post a reply to this thread.