I have a mysql query that I get data from mysql table. How can I properly check if there is result returned? My mysql table have 5 rows with data.
I have tried to equate mysqli_num_rows
to 0 but it does not work. It always return fail. I need it to return success.
I can't figure this out, how can I fix this?
my code:
$result=mysqli_num_rows($query)
if($result==0)
{
echo "Success";
}else
{
echo "fail";
}