help | mysql
#2

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.
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
}
Reply


Messages In This Thread
help | mysql - by EviLpRo - 12.06.2011, 04:42
Re: help | mysql - by [NoV]LaZ - 12.06.2011, 06:34
Re: help | mysql - by EviLpRo - 12.06.2011, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)