How can the comparison of strings be made case-insensitive in PHP database queries?

When comparing strings in PHP database queries, you can make the comparison case-insensitive by using the `LOWER()` function in your query. This function converts all characters in a string to lowercase, allowing for a case-insensitive comparison.

$searchTerm = 'John Doe';
$query = "SELECT * FROM users WHERE LOWER(name) = LOWER('$searchTerm')";
$result = mysqli_query($connection, $query);

// Fetch and process the results here