SA-MP Forums Archive
String not inserted into database - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: String not inserted into database (/showthread.php?tid=589096)



String not inserted into database - knackworst - 15.09.2015

Hi

I have a little problem inserting a string in a database field.
The string is saved in the var:
pawn Код:
PInfo[playerid][TikiString]
And whenever I wish to change the string, and then display it in the server it works. For example, if the string is:
Код:
0000
and I change it to
Код:
0001
and when I display the new string in the chat it works perfectly fine.
However when I try to save the updated string in my database, for some reason it doesn't change...

Here's the saving code:
pawn Код:
stock SaveData(playerid)
{
    new Query[700];// a querry
   
    format(Query, sizeof(Query), "UPDATE users SET admin = %d, pLevel = %d, tikistring = '%q', money = %d, score = %d, skin = %d, color = %d, kills = %d, reputation = %d, deaths = %d, vortexpb = %.2f, houses = %d, raceswon = %d, racesraced = %d, gold = %d, reactions = %d WHERE username = '%s'",
    PInfo[playerid][Level], PInfo[playerid][Exp], PInfo[playerid][TikiString], PInfo[playerid][Money], PInfo[playerid][Score],PInfo[playerid][Skin], PInfo[playerid][Color], PInfo[playerid][Kills],PInfo[playerid][Rep],PInfo[playerid][Deaths],PInfo[playerid][VortexPB], PInfo[playerid][Houses],PInfo[playerid][RacesWon], PInfo[playerid][RacesRaced], PInfo[playerid][Gold], PInfo[playerid][Reactions], DB_Escape(PInfo[playerid][Name]));
    db_free_result(db_query(Database, Query));

    return 1;
}
The relevant string is the PInfo[playerid][Tikistring], does anyone know how to properly save this string into the field: tikistring?

Thanks in advance


Re: String not inserted into database - knackworst - 15.09.2015

Update: none of my stats are saved in the database, I didn't have this problem before updating to 0.3.7, what's the problem?