12.06.2011, 06:34
Like I said in your last topic, mysql_query returns 1 on success and 0 on failure.
If you want to check if the player's password is correct you could use a query and mysql_num_rows.
If you want to check if the player's password is correct you could use a query and mysql_num_rows.
pawn Код:
new query[128];
format(query, sizeof (query), "SELECT * FROM `users` WHERE `name` = '%s' AND `password` = '%s';", ...);
mysql_query(query);
mysql_store_result();
if (mysql_num_rows())
{
// player has got the password right, do something
}
else
{
// the player sent a wrong password, do something
}