MD5 function in MYSQL Help
Posted: Wed Apr 30, 2008 10:35 pm
Hey guys, i am trying to have a php authentication login that check into the database:
from the echo query, this is the result:
select username,password from users where username like 'abcUserName' and password=MD5('abcPassword')
but it doesn't seem to work this way in mysql. Any comments??
Code: Select all
$web_username=$_SERVER['PHP_AUTH_USER'];
$web_password=$_SERVER['PHP_AUTH_PW'];
require_once('db-connect.php');
$query="select username,password from users where username like '";
$query1=$web_username."' and password=MD5('".$web_password."')";
$query=$query.$query1;
echo $query."<br/>";
$result=$connection->query($query);
select username,password from users where username like 'abcUserName' and password=MD5('abcPassword')
but it doesn't seem to work this way in mysql. Any comments??