MySQL register problem !
#1

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

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

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)