MySQL is not saving[++REP]
#1

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
Reply
#2

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.
Reply
#3

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

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.
Reply
#5

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.
Reply
#6

Help Please
Reply
#7

Anyone
Reply
#8

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
Reply
#9

Fixed
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)