I'm just getting started in PHP, and I'm getting this warning
"Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in E:\XAMPP\htdocs\loginapp\login.php on line 8"
Which is strange because my first parameter is indeed a result...
Here's my code
<?php
require "init.php";
$Username= $GET["Username"];
$Passwrd= $GET["Passwrd"];
$sql= "SELECT Name FROM login WHERE Username = '$Username' AND Passwrd = '$Passwrd'";
$result= mysqli_query($con, $sql);
if(!mysqli_num_rows($result)>0)
{
$status= "failed to connect";
echo json_encode(array("response"=>$status));
}
else
{
$row= mysqli_fetch_assoc($result);
$Name= $row['Name'];
$status= "connected";
echo json_encode(array("response"=>$status, "Name"=>$Name));
}
mysqli_close($con);
?>