What are the potential pitfalls of using multiple WHERE clauses in a SQL query in PHP?

Using multiple WHERE clauses in a SQL query can lead to unexpected results or errors if not handled properly. To avoid this, it is recommended to use the AND or OR operators to combine multiple conditions in a single WHERE clause.

// Example of using AND to combine multiple conditions in a WHERE clause
$sql = "SELECT * FROM table_name WHERE condition1 AND condition2";
$result = mysqli_query($conn, $sql);