• Mysqloo requirements - database:query returns nil
    3 replies, posted
When I run database:query( x ) it returns a nil value. The query is valid and I am running database.connect( ... ) prior to running database:query( x ); I do have libMySQL and gmsv_mysqloo.lua and am requiring the dll. I have used the sample code in the mysqloo thread and same thing. Exact error... [code] mysql.lua: attempt to index local 'QueryObj' (a nil value) [/code] [i]QueryObj is what is returned in database:query( x )[/i] This isn't an issue with the code there is a requirement I am missing. The module is being loaded correctly as the type of the database variable return Database. I have C++ Redistributableand and am running Windows Server 2008 R2.
Set your database object like... Zack = mysqloo.connect("information here") Zack:connect() from there, you are able to call Zack:query("SELECT `Zack` from `Zack` WHERE `Zack`=1"), like so. If you are still having errors, post your code. Make sure you call mysqloo.connect, and make sure that you call connect() on the object.
I fixed the problem- I was doing stuff in the background which was effecting the networking of the module. Thanks anyways though.
For future reference db:query only ever returns nil if the database isn't connected
Sorry, you need to Log In to post a reply to this thread.