What best practices should PHP developers follow when structuring SQL queries with multiple logical operators?

When structuring SQL queries with multiple logical operators, PHP developers should use parentheses to explicitly define the order of operations to ensure the query is executed correctly. This helps to avoid confusion and potential errors when combining AND and OR operators in complex queries.

$query = "SELECT * FROM table_name WHERE (condition1 AND condition2) OR condition3";