SA-MP Forums Archive
MySQL is not saving[++REP] - 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: MySQL is not saving[++REP] (/showthread.php?tid=481064)



MySQL is not saving[++REP] - ZBits - 14.12.2013

Hi, i looked at a tutorial on SA:MP forums for a mysql registration system. I got one and it works somehwhat fine.

Now the problem is, except for the Username and Password, nothing else saves. The score stays at 0, the admin level stays at 0 and same with deaths and kills.


Code Removed -

Problem fixed


Re: MySQL is not saving[++REP] - Toni - 14.12.2013

Are you sure it even successfully queries? Check the database and see if it changes your admin level in your database. What may be causing you to just receive your admin temporarily before relogging is when you set:

pInfo[target][pAdmin] = level;

However if the query didn't go through successfully, that code above is useless as it doesn't save in the database to load next time the user logs in.


Re: MySQL is not saving[++REP] - ZBits - 14.12.2013

No it does not change in my database, only gives me the rights temporarily in game until relog


Re: MySQL is not saving[++REP] - Toni - 14.12.2013

Quote:
Originally Posted by Domnic Toretto
View Post
Not it change in my database, only gives my the rights temporarily in game until relog
Trying to understand what you just said. Are you saying it didn't change in the database after you set the user's admin level? If it didn't update to the level you set it to, then yes it is temporary because although the query doesn't work, you still set the admin level for the player via the enumerator. Meaning, what is causing it to be an only temporary admin level is because your query doesn't work.


Re: MySQL is not saving[++REP] - ZBits - 14.12.2013

Sorry for that bad English up there, idk what happened to it.

Now, yes it doesn't update in my database... I dont get what you said "you query doesn't work", if its temporary... how do i make it save in my database? and not assign myself rank every time i log in.


Re: MySQL is not saving[++REP] - ZBits - 14.12.2013

Help Please


Re: MySQL is not saving[++REP] - ZBits - 14.12.2013

Anyone


Re: MySQL is not saving[++REP] - Patrick - 14.12.2013

Quote:
Originally Posted by Domnic Toretto
View Post
Anyone
Enabling the debug would be very helpful or if you already enabled it, show us the mysql_log.txt

Source: https://sampwiki.blast.hk/wiki/MySQL#mysql_debug


Re: MySQL is not saving[++REP] - ZBits - 15.12.2013

Fixed


Re: MySQL is not saving[++REP] - ZBits - 15.12.2013

Fixed, for people who do want to know how i fixed this, this is the way



I changed the
pawn Code:
%d
to
pawn Code:
%i
and it worked. Same with the setlevel command, change %d to %i for things such as score, kills, money, death.

Thanks