I've looked at a few of the other md5 threads and haven't found what I was looking form surprisingly. I'm trying to login a user but it always gives me an error and says that the username and password don't match in the database.
<?php
//script to accept the variables from a form and encrypt the password so that it matches the database
if((isset($_POST['uname']))&&(isset($_POST['pword']))){
$pword = md5($_POST['pword']);
$uname = $_POST['uname'];
$sql = "SELECT * FROM `tblPhotographer` where Uname ='$uname' AND Pword = '$pword'";
echo "<br />";
echo $sql;
$result = mysql_query($sql)or die(mysql_error());
if(mysql_num_rows($result) > 0){
while ($row = mysql_fetch_array($result)) {
echo "<br />";
echo "The user is";
echo $_row['Uname'];
echo "<br />";
echo $row['Pword'];
?>
When i just have it echo an md5() encrpyted password that I know is correct it matches exactly to the one already in the database but when I try the select statement, it kicks out the error that no rows are returned. Any Ideas?