i know this is simple..but i am unable to find the error..i have a login page where i take the input from user i.e. the username and password.then another page i am checking whether the values are present in the database or not.but neither it is giving me an error nor its working..moreover its not entering the first if condition..if ($result->num_rows > 0)
<body style="background-color:lightgrey;">
<?php
include('custdb.php');
session_start();
$uname=$_POST['username'];
$pass=$_POST['password'];
$sql = "SELECT * FROM `info` WHERE `username`='".$uname."';";
//echo $sql;
$result = $conn->query($sql);
echo"1";
echo $result;
if ($result->num_rows > 0)
{
echo"1";
while($row = $result->fetch_assoc())
{
if($uname==$row["username"])
{
header("location:custprofile.php");
}
else
{
header("Location:custindex.php");
}
}
}
else
{
echo "invalid input";
echo '<h4 align="left"><a href="custindex.php">LOGIN</a> </h4>';
}
?>