PHP Warning:Mysqli_Num_Rows() Expects Parameter 1 to Be MySQLi_Result, Object Given

mysqli_num_rows() expects parameter 1 to be mysqli_result, object

You're combining procedural and object oriented approaches, when you only want object oriented. Change

$num=mysqli_num_rows($WHAT);

to

$num = $stmt->num_rows();

PHP & MySQL: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

$dbc is returning false. Your query has an error in it:

SELECT users.*, profile.* --You do not join with profile anywhere.
FROM users
INNER JOIN contact_info
ON contact_info.user_id = users.user_id
WHERE users.user_id=3");

The fix for this in general has been described by Raveren.

mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean with mysqli

According to another question here :

The INSERT command will return a boolean(true/false), So you must use select command to get the required result

mysqli_num_rows() expects parameter 1 to be mysqli_result, object given

You cannot use mysqli with PDO

if you want to count the rows in PDO do this:

if($result->rowCount() === 0)

PDOStatement::rowCount



Related Topics



Leave a reply



Submit