What are the potential pitfalls of using single quotes around table names and field names in SQL queries in PHP?

Using single quotes around table names and field names in SQL queries in PHP can lead to syntax errors or SQL injection vulnerabilities. To avoid these pitfalls, it is recommended to use backticks (`) instead of single quotes when referencing table names and field names in SQL queries.

// Example of using backticks instead of single quotes to reference table names and field names in SQL queries
$table = 'users';
$field = 'username';

$sql = "SELECT `{$field}` FROM `{$table}` WHERE `{$field}` = 'example'";