How should column names be referenced in PHP queries to avoid errors?

When referencing column names in PHP queries, it is important to enclose the column names in backticks (`) to avoid any errors, especially if the column names contain reserved keywords or special characters. This helps PHP to interpret the column names correctly and prevents syntax errors in the queries. Example:

$query = "SELECT `column1`, `column2` FROM `table_name` WHERE `column3` = 'value'";