01.01.2011, 23:24
1st of all, DON'T post stuff that does not relate this.
So I want to hash passwords with MySQL and MD5, i used to use other hash, stock version. But I want to use the MD5 that comes with MySQL
So this is the reg system
Ok, that works good. But how would i log in?
This is the log in bit:
So I want to hash passwords with MySQL and MD5, i used to use other hash, stock version. But I want to use the MD5 that comes with MySQL
So this is the reg system
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `Accounts` (`Username`, `Password`) VALUES ('%s', md5('%s'))", EscName, EscPass, PIP);
mysql_query(Query);
This is the log in bit:
pawn Код:
format(Query, sizeof(Query), "SELECT * FROM `Accounts` WHERE `Username` = '%s' AND `Password` = '%s'", pName(playerid), EscPass);
mysql_query(Query);
mysql_store_result();
if(!mysql_num_rows())
{
// Incorrect Pass
}
else
{
// Correct Pass
}