[SQL] Error
Hello,
I've my code : Code:
public void T_SelectPlayerTime(Database db, DBResultSet results, const char[] error, any data) { Code:
L 08/18/2019 - 21:55:10: [csgo_timer.smx] T_InsertPlayerTime failed! You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ballz', 'STEAM_1:1:86693297')' at line 1 Thanks, Had3s99. |
Re: [SQL] Error
I think it may be the ' symbols. As a side note, make it a habit to use Database.Format for queries in the future.
|
Re: [SQL] Error
Quote:
Code:
FormatEx(l_sQuery, sizeof(l_sQuery), "INSERT INTO Time_Players (Pseudo, SteamId) VALUES ('%s', '%s')", l_sPseudo, l_sSteamId); I don't understand everything cause i'm not very good in english ^^ |
Re: [SQL] Error
Quote:
Code:
Dbase.Format(l_sQuery, sizeof(l_sQuery), "INSERT INTO Time_Players (Pseudo, SteamId) VALUES ('%s', '%s')", l_sPseudo, l_sSteamId); |
Re: [SQL] Error
change
Code:
FormatEx(l_sQuery, sizeof(l_sQuery), "INSERT INTO `Time_Players` (Pseudo, SteamId) VALUES ('%s', '%s')", l_sPseudo, l_sSteamId); Code:
FormatEx(l_sQuery, sizeof(l_sQuery), "INSERT INTO `Time_Players` (Pseudo, SteamId) VALUES (%s, %s)", l_sPseudo, l_sSteamId); |
Re: [SQL] Error
PHP Code:
|
Re: [SQL] Error
So to fix my problem i've do that :
Dbase.Escape(l_sPseudo, l_sPseudoESC, sizeof(l_sPseudoESC)); And thanks for the Dbase.Format i don't know that ^^ And for the charset 'utf8mb4' it's only available on sourcemod 1.10 ? ^^ |
All times are GMT -4. The time now is 05:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.