What common syntax error is often encountered in PHP MySQL queries?

A common syntax error encountered in PHP MySQL queries is missing quotation marks around values in the query. This can lead to syntax errors or unexpected behavior when executing the query. To solve this issue, make sure to properly quote string values in the query using single quotes ('').

// Incorrect query without proper quotation marks
$query = "SELECT * FROM users WHERE username = $username";

// Corrected query with proper quotation marks
$query = "SELECT * FROM users WHERE username = '$username'";