[MySQL] Registering players.
#1

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

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

Your id field probably isn't AUTO INCREMENT
Reply
#4

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

did you mysql_debug(1); when connecting?
Reply
#6

Nope, I put this now. What should I do now?
Reply
#7

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

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

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 )
Reply
#10

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:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)