What is the significance of using single quotes around values in a SQL query in PHP?
When writing a SQL query in PHP, it is important to use single quotes around string values in the query to ensure proper syntax and prevent SQL injection attacks. By enclosing values in single quotes, you are telling the database that the value is a string literal and not a column name or SQL command.
// Example SQL query with single quotes around values
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";