Problem with mysql - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Problem with mysql (
/showthread.php?tid=205971)
Problem with mysql -
Yvax - 02.01.2011
Hi,I have a problem with my MySQL registration/login system.When a player connects,registers instead of inserting the player's name in field 'Name'(MYSQL Database) it inserts a number...I don't know what's the problem and what I am doing wrong.
Heres my MySQLCreateAccount:
Code:
public MySQLCreateAccount(newplayersname[], newpassword[])
{
new query[128];
new sqlplyname[MAX_PLAYER_NAME];
new sqlpassword[64];
samp_mysql_real_escape_string(newplayersname, sqlplyname);
samp_mysql_real_escape_string(newpassword, sqlpassword);
format(query, sizeof(query), "INSERT INTO players (Name, Password) VALUES ('%s', '%s')", sqlplyname, sqlpassword);
samp_mysql_query(query);
new newplayersid = MySQLCheckAccount(newplayersname);
if (newplayersid != 0)
{
return newplayersid;
}
return false;
}