Hello, I have been having problems with my tables not being saved or ANYTHING for that matter…
Here is the coding ( and the problem below it)
function Test.NewAccount(ply) local db, error = mysql.connect("*********", "********", "********", "********") if(db == 0) then Msg(error .. " ") return end local steamid = ply:SteamID() local succ, error = mysql.query(db, "INSERT INTO test_accounts (steamid,test1,test2,test3,rank) VALUES(" .. steamid ..", 0, 0, 0, 0)"); if(succ) then PrintTable(succ) Msg("Account Created, 0 Characters At The Moment! " else print(tostring(error) .. " "); end mysql.disconnect(db) end function Test.Preload(ply) local db, error = mysql.connect("******", "*******", "******", "*******") if(db == 0) then Msg(error .. " ") end local preload, checkexist = mysql.query(db, "SELECT * FROM liquidrp_accounts WHERE steamid='"..tostring(ply:SteamID()).."')"); if(checkexist == false) then Msg("Account doesn't exist ") Test.NewAccount(ply) else PrintTable(preload) end mysql.disconnect(db) end
The Current problem is, on initial spawn it calls the preload… Recognizes there is no account, and class new account… And new account claims the message “Account Created… etc”
But its not saving, because everytime I rejoin it goes through the same thing OVER and OVER and OVER.
Could it be where I placed my DLL btw? I placed in the orangebox folder(before gmod, cuz it said the gmod/gmod first one, and didn’t have that so just assumed) also both dlls needed in the lua/includes/modules are in the corect folder.
Any Ideas? :3 Thanks in advance.
ADDITIONAL INFO: I checked the tables, and nothing is being created.
EDIT: i think the problem was I forgot the ’ '?