Error Message
When using HTML Purifier to filter user input and executing a query using mysqli_query(), you may encounter the error:
1 |
|
This error occurs when mysqli_num_rows() is called with a boolean value instead of an mysqli_result object.
Solution
The root cause of the error is an issue in the SQL query. In the given code, the query:
1 2 3 4 5 |
|
contains an error: there is no JOIN with the profile table anywhere in the query. To fix this, you need to include the correct JOIN statement in the query.
The corrected query:
1 2 3 4 5 |
|
The above is the detailed content of Why Does `mysqli_num_rows()` Return 'boolean given' After Using HTML Purifier and `mysqli_query()`?. For more information, please follow other related articles on the PHP Chinese website!