I am a beginner in PHP. when I try to do mysql_num_rows it is giving an error:
Warning: mysql_num_rows() expects parameter 1 to be resource, object given in D:\xampp\htdocs\kcp\police\viewcase.php on line 22
This is the code:
<?php
session_start();
if(empty($_SESSION['pusername'])||empty($_SESSION['pid']))
{
header('location://localhost/kcp/police_login.html');
exit();
}
else
{
$station=$_SESSION['station'];
$con = mysqli_connect('localhost','root','','kcp');
if(!$con)
{
echo 'NOT CONNECTED TO DB';
}
$sql="SELECT * FROM complaint WHERE station='$station'";
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$res=mysqli_query($con,$sql) or die("llllllll");
$numrow=mysql_num_rows($res);
echo $numrow;
}
?>