I am a beginner in PHP. I am trying to run the following code in my php file but it is fetching me no result although data is present with same entry in my SQL table.
<?php
echo "this is the start";
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "PW3";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
echo "Unable to connect to databse";
die("Connection failed: " . mysqli_connect_error());
}
else {
echo "Connected";
if(!empty($_POST["username"]) && !empty($_POST["password"])){
$username=$_POST['username'];
//echo "$username";
$sql="SELECT fullname FROM `users` WHERE username=ashish";
$result1=mysqli_query($conn,$sql);
print_r($result1);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result1);
echo "$count";
}
}
echo "<br>this is the end";
?>