SA-MP Forums Archive
MySQL register problem ! - 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 register problem ! (/showthread.php?tid=513908)



MySQL register problem ! - xPirate - 18.05.2014

Description:


There's a slight problem that i came across before. Somehow it wont save my stats inside the database. I can't really describe it any more simple than that when i enter the server, i have to register every time in order to play.
What am i doing wrong?

here's the code.
http://pastebin.com/4MGTBtYq


Re : MySQL register problem ! - Ramoboss - 18.05.2014

replace your query1[350] by query1[1020];

also, when you register your account, go to you mysql database and check if your account is added


Re: MySQL register problem ! - xPirate - 18.05.2014

Hmm, it doesn't seem to be helping.
Any other suggestions ?


Re: MySQL register problem ! - MacT - 18.05.2014

pawn Код:
format(query1, sizeof(query1), "INSERT INTO playerdata (user, password, score, money, level, vip, rank, kills, deaths, muted, jailed, frozen, mutedtimes, jailedtimes, frozentimes, logins, posx, posy, posz, posa, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s')", pname, passwordstring, GetIP(playerid));
    mysql_query(query1);
I deleted 0ne zero because it was excessively, If this won't help you, let me know.


Re: MySQL register problem ! - xPirate - 18.05.2014

I still have to register each time i enter but i do get a new account line in the database. however i registered twice with the same name and it wrote down both in the database. it didnt bring up the login dialog any ideas how to fix that?


Re: MySQL register problem ! - kamiliuxliuxliux - 18.05.2014

Line under OnPlayerConnect: new rows = mysql_num_rows();

Must be under mysql_query (when you execute a query) because if you put it before query execution, it always returns you zero.

+rep if helped