tags:

views:

106

answers:

1

code-

$q="SELECT * FROM tbl_quevote WHERE que_id = '".$qid."' and voteby='".$uid."'";

$result = $mysqli->query($q) or die(mysqli_error($mysqli));
$num_rows = mysql_num_rows($result);

echo $num_rows;

Error: Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\xampp\htdocs\shizin\voting.php on line 13
how to check result is empty?

+5  A: 
$num_rows = $result->num_rows;
+1 - For the right answer, but it helps to give more info. http://www.php.net/manual/en/mysqli-stmt.num-rows.php, as num_rows is part of the mysqli extension and mysql_num_rows is part of a different extension.
James Black