What are the potential issues with using single quotes around field names in SQL queries in PHP?

Using single quotes around field names in SQL queries in PHP can lead to syntax errors or unexpected behavior, especially if the field name contains special characters or spaces. To avoid this issue, it is recommended to use backticks (`) around field names instead of single quotes.

<?php
// Incorrect way with single quotes
$query = "SELECT 'field_name' FROM table_name";

// Correct way with backticks
$query = "SELECT `field_name` FROM table_name";