I need to select only the password from the table with the specific username entered through the log in form. I store the password in the encrypted form in the mysql table. So I need to compare the given password and stored password and have to print "logged in successfully". else password is incorrect. this is my code.Now I am getting the output as "1Resource id #4".can any one plz help...
mysql_select_db($dbName);
$user_name=$_POST['name'];
$pswd=$_POST['pswd'];
$res = mysql_query("select * from xxx where Name='$user_name'");
$row = mysql_num_rows($res);
echo $row;
$encpass=mysql_query("SELECT password FROM xxx WHERE Name = '$user_name'");
$result1= mysql_fetch_array($encpass);
echo $result1;
if($row>0)
{
//echo 'hi';
if(md5($pswd)==$result1)
{
echo 'hi';
echo "you have successfully signed in!!!";
//echo $name = $row['Name'];
//header("location:check.html");
}
}
else
echo "you are not a member";