06.08.2010, 17:58
I'm not sure what I am having a problem with right now, seems as everything is fine;
This is my dialog code; used for DIALOG_STYLE_INPUT.
I have tried registering, but it comes out pretty odd.
Console Output (Stricken Kid's):
And this is the output after registering in phpMyAdmin:
Apparently that was my value 'username'.
Can someone please help.
pawn Код:
if(dialogid == DReg)
{
if(response == 1)
{
new
str[128],
password[50];
format(str, 128, "SELECT * FROM `playerinfo` WHERE `user` = '%s'", pName(playerid));
mysql_query(str);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SendClientMessage(playerid, RED, "ERROR: This account is already registered!");
ShowPlayerDialog(playerid, DLogin, DIALOG_STYLE_INPUT, "RC:RP Login", "Please enter your password below to login", "Login", "Cancel");
mysql_free_result();
return 1;
}
mysql_free_result();
CMySQL_Create(str, ACCOUNT_TABLE, "User");
CMySQL_Password(str, ACCOUNT_TABLE, "Password", inputtext);
CMySQL_SetInt(str, ACCOUNT_TABLE, "User", "Money", 5000);
}
else
{
SendClientMessage(playerid, GREEN, "You have cancelled registration, you have been kicked");
Kick(playerid);
}
}
I have tried registering, but it comes out pretty odd.
Console Output (Stricken Kid's):
Quote:
[12:59:22] [join] Toni_Tang has joined the server (0:192.168.1.75) [12:59:27] MySQL Error (0): Could not execute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM `playerinfo` WHERE `user` = \'Toni_Tang\' = ''' at line 1. |
Quote:
SELECT * FROM `playerinf |
Can someone please help.