23.01.2013, 17:52
Hello, when i enter the correct password it always says that it's incorrect.. I have no idea where I have gone wrong and been trying different things to fix it but.. no luck
pawn Code:
public Mysql_Login(playerid, password[])
{
mysql_real_escape_string(PlayerName(playerid), PlayerName(playerid));
mysql_real_escape_string(password, password);
new Hash[129], Query[500];
WP_Hash(Hash, 129, password);
format(Query, 500, "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'", PlayerName(playerid), Hash);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You have been logged in and your {FF0000}stats are loaded");
LoggedIn[playerid] = 1;
}
else
{
SendClientMessage(playerid, -1, "Wrong password");
}
mysql_free_result();
return 1;
}