MD5 and MySQL
#1

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
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `Accounts` (`Username`, `Password`) VALUES ('%s', md5('%s'))", EscName, EscPass, PIP);
mysql_query(Query);
Ok, that works good. But how would i log in?

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


Messages In This Thread
MD5 and MySQL - by [L3th4l] - 01.01.2011, 23:24
Re: MD5 and MySQL - by Vince - 01.01.2011, 23:27
Re: MD5 and MySQL - by _rAped - 01.01.2011, 23:29
Re: MD5 and MySQL - by FreshDoubleX - 01.01.2011, 23:31
Re: MD5 and MySQL - by _rAped - 01.01.2011, 23:33
Re: MD5 and MySQL - by Sergei - 01.01.2011, 23:53

Forum Jump:


Users browsing this thread: 1 Guest(s)