What are some best practices for formatting long SQL queries in PHP for database operations?

When dealing with long SQL queries in PHP for database operations, it is important to format the query properly for readability and maintainability. One best practice is to break the query into multiple lines to improve readability. Another best practice is to use PHP's heredoc syntax for multi-line strings to make the query more readable.

$query = <<<SQL
SELECT column1, column2, column3
FROM table1
WHERE condition1 = 'value1'
AND condition2 = 'value2'
ORDER BY column1 ASC;
SQL;