What common error message might occur when using a WHERE LIKE query in PHP?

When using a WHERE LIKE query in PHP, a common error message that might occur is "Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given". This error typically occurs when the query does not return any results, resulting in a boolean value (false) being returned instead of a mysqli_result object. To solve this issue, you can check if the query was executed successfully before attempting to fetch the results.

// Execute the query
$result = mysqli_query($connection, "SELECT * FROM table WHERE column LIKE '%search%'");

// Check if the query was successful
if($result){
    // Fetch the results
    while($row = mysqli_fetch_assoc($result)){
        // Process the results
    }
} else {
    echo "No results found.";
}