SA-MP Forums Archive
[MySQL] Registering players. - 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] Registering players. (/showthread.php?tid=414870)



[MySQL] Registering players. - Activest - 10.02.2013

Hello.

My system is registering only one user in the MySQL,
I don't know why it's not registering one more playter that trying to register my server.

What is the problem?
This is the code:
Quote:

new querysd[200], escstring[100];
mysql_real_escape_string(inputtext, escstring);
format(querysd, sizeof(querysd), "INSERT INTO `users` (User, Password, Level) VALUES('%s', SHA1('%s'), 1)", PName(playerid), escstring);
mysql_query(querysd);

It's registering one player in MySQL, but If I try with new user name it's not.
If I delete the user in MySQL and then trying again, it's registering in the MySQL.


Re: [MySQL] Registering players. - Vince - 10.02.2013

Need to see some logs to determine what's wrong. I'm suspecting something with a duplicate key.


Re: [MySQL] Registering players. - InfiniTy. - 10.02.2013

Your id field probably isn't AUTO INCREMENT


Re: [MySQL] Registering players. - Activest - 11.02.2013

Well guys, what should I do? what need I to check?
It's registering only one user...

Vince - how to check the logs?
Adytza- can you explain?


Re: [MySQL] Registering players. - PaulDinam - 11.02.2013

did you mysql_debug(1); when connecting?


Re: [MySQL] Registering players. - Activest - 11.02.2013

Nope, I put this now. What should I do now?


Re: [MySQL] Registering players. - InfiniTy. - 11.02.2013

Well go to your table and then to structure and see if id is AUTO-INCREMENT


Re: [MySQL] Registering players. - Activest - 11.02.2013

I don't know what are you meaning, but this is a part of structure:



Re: [MySQL] Registering players. - InfiniTy. - 11.02.2013

Well add a new row and call it id,make it INT and make it AI(AUTO INCREMENT)(should be the first row it begins the table with..not username or whatever you have )


Re: [MySQL] Registering players. - Activest - 11.02.2013

I made it, but it's still doesn't work, it made only one account.
I guess I need to make also something when LoadPlayerData or in string of INSERT INTO?

picture: