20.06.2017, 13:15
Hello, Today I decided to use MySQL instead of y_ini but the problem is, when I try to register my account the account saves on my database and then I logged in with the similar password It let me login to the server even though it is wrong password.
For Example:
Username:KizZweLL
Password:NoobAtMysql
then I tried to login with this password
Password:NoobAtMysqls
I came up on joining the server even though it is a wrong password.
Please help me to fix this.
here's my Code:
My database format is
users:
account password.
For Example:
Username:KizZweLL
Password:NoobAtMysql
then I tried to login with this password
Password:NoobAtMysqls
I came up on joining the server even though it is a wrong password.
Please help me to fix this.
here's my Code:
PHP Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case LOGIN:
{
if(response)
{
new query[126] , Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(query,sizeof(query),"SELECT * FROM users WHERE name = '%s' AND password = '%s'",Name,inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, ""Caption"Register",""Red"You have entered an invalid password.\n"White"Type your password below to register a new account.","Register","Quit");
}
}
}
users:
account password.