Server Manager Addon Part 2

Yeah, yet another error…
Im not sure how to fix it either, so thats why im here.
Not sure whats going on but this one error is breaking my server:

And here is the code for the general area this might be in(also, note that the first line in this code is actually the 9th line in the real lua file):


function connectToDatabase()
	databaseObject = mysqloo.connect(DATABASE_HOST, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)
	databaseObject.onConnected = function() print("Database linked!") end
	databaseObject.onConnectionFailed = function() print("Failed to connect to the database.") end
	databaseObject:connect()
end
 
connectToDatabase()

function checkQuery(query)
    local playerInfo = query:getData()
    if playerInfo[1] ~= nil then
	return true
    else
	return false
    end
end

function FirstJoinMysql( ply )
    local query1 = databaseObject:query("SELECT * FROM online_players WHERE steam = '" .. ply:SteamID() .. "'")
    query1.onSuccess = function(q)
        if not checkQuery(q) then
	    local query2 = databaseObject:query("INSERT INTO online_players(steam, rp_name) VALUES ('" .. databaseObject:escape(ply:SteamID()) .. "', '" .. databaseObject:escape(ply:Nick()) .. "')")		// else create the bugger
	    query2.onSuccess = function(q)  print("Added you to online clients") end
	    query2.onError = function(q,e) print("something went wrong") end
	    query2:start()	
        else
            print("You are already created!")
        end
    end
    query1.onError = function(q,e) print("something went wrong when checking") end
    query1:start()
end
hook.Add( "PlayerInitialSpawn", "PlayerInitialSpawn", FirstJoinMysql )

If anyone has any ideas on whats going on please hit me up! Thanks :zoid:

It literally says what’s wrong with it…

It got string while it was expecting a number.

Where though? Im sorry im quite tired and not the best at GLua but like, i cant tell where

It also tells you on which line.

it says 10 and 16

The error actually happened at line 16, but traced the source of the problem at line 10.

[editline]14th March 2015[/editline]

Your DATABASE_PORT seems to be wrong. That would be the only thing I’d guess that’d be expecting a number.

ok thank you, i will check it out

I found out what was wrong. It was the port. For some reason its suppose to be PORT instead of “PORT”