I have been working on this code for a while. This part I am stuck on and kinda confused. So I see nothing wrong with the query, and when it is sent to the database it returns success, but no tables are affected. This is the code:
function levelup.database.save( charid, char, ply) local char = string.Replace( char, " ", "-" ) local linked = (charid .. char) print(ply.levelup.experience) print(ply.levelup.level) local qry = lvlDB:query( "UPDATE `exp_players` SET `level` = " .. ply.levelup.level .. ", `experience` = " .. ply.levelup.experience .. " WHERE `id` = '" .. linked .. "'" ) qry.onError = function( q, err, sql ) print( "[SPECIAL] Database Error: " .. err ) qry:abort() end qry.onSuccess = function( q, data ) print( "[SPECIAL] Saved Userdata" ) end qry:start() print( "[SPECIAL] Affected Rows: " .. qry:affectedRows() ) end
One thing I know for sure is “ply.levelup.experience” and “ply.levelup.level” are defined differently. That is why those two print lines are there, So I can see what they are before running the query. There is nothing wrong with the query sent from what I can tell. If anyone could spot the problem, help would be much appreciated. Also if you need more context code, just ask. Thanks.