What are the potential pitfalls of using single quotes for column names in SQL queries when using PHP?

Using single quotes for column names in SQL queries when using PHP can lead to syntax errors or unexpected behavior, especially if the column name contains special characters or spaces. To avoid this, it is recommended to use backticks (`) around column names in SQL queries to ensure proper parsing by the database engine.

// Example of using backticks for column names in SQL queries
$column_name = 'column_name';
$sql = "SELECT `$column_name` FROM table_name";
$result = mysqli_query($connection, $sql);