SA-MP Forums Archive
mysql -saving - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql -saving (/showthread.php?tid=242127)



mysql -saving - Jony_King - 19.03.2011

Hey guys,
i have a little problem with my sql-system.
It works pretty fine, but my user-name wont be save.
That is my big problem.
Here is some code:
pawn Код:
//Register
        new pName[MAX_PLAYER_NAME],query[300];
        GetPlayerName(playerid, pName, sizeof(pName));
        cvar[playerid] = 1;
        format(query, sizeof(query), "INSERT INTO samp_accounts (pKey,pName,cvar) VALUES ('%s','%s',%d)", password, pName,cvar[playerid]);
        printf("%s",query);
        mysql_query(query);
        mysql_free_result();
The query looks alright. My name is right in the "printf" output.
The database structure should be also alright, because, the key will be saved rightly.


Re: mysql -saving - JaTochNietDan - 19.03.2011

Can you show what the print says?

Also why are you using mysql_free_result when you haven't stored anything?

Additionally I suggest you enable MySQL logging, then you will be able to see if there is an error with the query in a new file called mysql_log.txt which is created when you enable logging.