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
Quickest Way to Read First Line from File
PHP Date Showing '1970-01-01 ' After Conversion
Can't Find the File Created by Outfile in MySQL
How to Enable Shell_Exec and Exec on PHP
Upload Multiple Images with Jquery Ajax and Process Them with PHP
Whats the Best Way to Do User Authentication in PHP
Is This the Correct Way to Send Email with PHP
Utf8 Filenames in PHP and Different Unicode Encodings
Cosine Similarity VS Hamming Distance
How to Work with Many-To-Many Relations in Yii2
How to Load a PHP File into a Variable
Setting Element of Array from Twig
What Is the Overhead of Using PHP Int
PHP How to Go One Level Up on Dirname(_File_)
A Restful Persistence Solution Usable with Backbone.Js... in PHP