How to check result is empty or not in php

by Vinoth 2010-02-05 11:20:48

Here the code to check the number of rows in a result and to check whether the result set is empty or not

$user_res=mysql_query($query);
$rows=mysql_num_rows($user_res);//Used to find no.of rows in a resultset
if($rows==0){
echo "Resultset is empty";
}

Tagged in:

983
like
0
dislike
0
mail
flag

You must LOGIN to add comments