mysqloo problem

Post Reply
probie93
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Sep 16, 2012 9:37 am

mysqloo problem

Post by probie93 »

Hi,
I'm trying to run the mysqloo module on my gmod server.
The reason I'm doing this is to have the players times recorded into a database, such as how long they are connected.
I'm currently just trying to simply connect to the database, and have it print telling me when it succeeds or fails.

Code: Select all

require("mysqloo")
 
local DATABASE_HOST = "localhost"
local DATABASE_PORT = 3308
local DATABASE_NAME = "sga_time"
local DATABASE_USERNAME = "sga"
local DATABASE_PASSWORD = "*******" 

local databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME,DATABASE_PORT)

if databaseObject != null then
databaseObject:connect()
print(databaseObject:status())
databaseObject.onConnectionFailed = function(D, E) print( "[Utime] Failed to Connect to Database: " .. E ) end
databaseObject.onConnected = function(D, E) print( "[Utime]  Connect to Database: " .. E ) end
end


I left out the password for security.
When I run this I get it to print "1" which is connecting. Then nothing.
Any help would be appreciated.
Thanks,
Probie93
probie93
New to forums
New to forums
Posts: 2
Joined: Sun Sep 16, 2012 9:37 am

Re: mysqloo problem

Post by probie93 »

Figured it out
Post Reply