hi.
so i'm trying to check database if player exist ( steamid ).
the query is fine but the result is not ?
on my database i can clearly see my manually entered steam id ( modified here with * to keep it private ****1198115562342 ) .
when i log into the server in the game , my steamid is still the good one in chat and server console.
but mariadb query result is always " 7.65612e+16 "
WTF ???
did it all myself according to some tutorial , the wiki and base script as exemple sicne im learnign lua. thats why i dont ask any code and dont use any base or rp ready gamemode.
here is my server code
by the way , the database steam_id column is varchar because they all say to not use int.
also , yes , i tried ToString.
can you help me please ? no error at all in any log file.
the is mariadb log line about my query
because the result is wrong , i cant do anything else like show a login form or whatever.
console giving the right steamid
thank you
so i'm trying to check database if player exist ( steamid ).
the query is fine but the result is not ?
on my database i can clearly see my manually entered steam id ( modified here with * to keep it private ****1198115562342 ) .
when i log into the server in the game , my steamid is still the good one in chat and server console.
but mariadb query result is always " 7.65612e+16 "
WTF ???
did it all myself according to some tutorial , the wiki and base script as exemple sicne im learnign lua. thats why i dont ask any code and dont use any base or rp ready gamemode.
here is my server code
Code:
function OnPlayerSteamAuth(player) print("Player "..player.." authenticated with SteamId "..GetPlayerSteamId(player)) AddPlayerChat(player, GetPlayerSteamId(player)) local query = mariadb_prepare(db, "SELECT * FROM users WHERE steam_id = '?' LIMIT 1", GetPlayerSteamId(player)) mariadb_query(db, query, LoadPlayer, player) end AddEvent("OnPlayerSteamAuth", OnPlayerSteamAuth) function LoadPlayer(player) local rows = mariadb_get_row_count() if (rows == 0) then AddPlayerChat(player, "No account found for that steamId") else AddPlayerChat(player, "there is an account for that steamId") end
also , yes , i tried ToString.
can you help me please ? no error at all in any log file.
the is mariadb log line about my query
Code:
[2021-01-02 09:55:08.190] [mariadb] [info] query "SELECT * FROM users WHERE steam_id = '7.65612e+16' LIMIT 1" successfully executed within 0.867 milliseconds [2021-01-02 09:55:08.190] [mariadb] [debug] ResultSet::Create(connection=0x10a2bfdd1f0, query_str='SELECT * FROM users WHERE steam_id = '7.65612e+16' LIMIT 1')
console giving the right steamid
Code:
2021-01-02 09:54:36 [info] Server loaded. Entering simulation... 2021-01-02 09:55:07 [info] Client requesting connection 127.0.0.1:54103 2021-01-02 09:55:07 [info] Player (ID 1) joining the game (127.0.0.1:54103) 2021-01-02 09:55:08 [script] Player 1 authenticated with SteamId ****1198115562342 2021-01-02 09:55:21 [info] Player (ID 1) disconnected (127.0.0.1:54103)
Comment