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
SQL PHP Error: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
This is because $conn->query($sql);
returned FALSE
. Your call $conn->query($sql);
was not successful.
You have an error in your syntax:
$sql = "SELECT * FROM tbl_flights WHERE pilot_initial_post IS NULL OR = '' AND is_deleted = '0'";
should be changed to
$sql = "SELECT * FROM tbl_flights WHERE (pilot_initial_post IS NULL OR pilot_initial_post = '') AND is_deleted = '0'";
The OR operator requires the field_name.
And for debugging add or die(mysqli_error($conn));
to your $conn->query($sql);
call.
PHP :Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, string given
Just change this code
$query= "SELECT * FROM residential ";
Into
$query= "SELECT * FROM residential WHERE 1";
And change this code
<?php if(mysqli_num_rows($query)>0):?>
<?php while($row= mysqli_fetch_assoc($query)):
print_r($row);
die;
?>
To
<?php
$res = mysqli_query($con, $query); //replace $con with your db connection variable
if(mysqli_num_rows($res)>0):?>
<?php while($row= mysqli_fetch_assoc($res)):
print_r($row);
die;
?>
What does it want? - mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
You have a comma before FROM
in your select
statement.
Related Topics
Achieve Hierarchy, Parent/Child Relationship in an Effective and Easy Way
Limit Keyword on MySQL With Prepared Statement
Setting Up a Deployment/Build/Ci Cycle For PHP Projects
Delete Directory With Files in It
Reference: Comparing PHP'S Print and Echo
Why Do Some Scripts Omit the Closing PHP Tag, '≫'
How to Declare a Global Variable in PHP
How to Add Http:// If It Doesn't Exist in the Url
Json_Encode() Escaping Forward Slashes
Laravel 5.5 Ajax Call 419 (Unknown Status)
"The Page Has Expired Due to Inactivity" - Laravel 5.5
Sorting a PHP Array of Arrays by Custom Order
Get Sum of MySQL Column in PHP
How Does True/False Work in PHP
How to Get the Error Message For the Mail() Function
How to Enable Curl in PHP/Xampp