Warning: mysql

Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select

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:xampphtdocsshizinvoting.php on line 13
how to check result is empty?


$num_rows = $result->num_rows;

int mysql_num_rows ( resource $result ) Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use mysql_affected_rows() .

链接地址: http://www.djcxy.com/p/69216.html

上一篇: 警告:mysql

下一篇: 警告:mysql