What is the potential issue with using single quotes for variables in PHP and how can it affect SQL queries?

Using single quotes for variables in PHP can cause issues when constructing SQL queries because variables inside single quotes are not parsed by PHP. This can lead to SQL syntax errors or vulnerabilities like SQL injection. To solve this issue, variables should be concatenated into the SQL query string using double quotes or prepared statements should be used to prevent SQL injection.

// Using double quotes for variables in SQL query
$name = "John";
$sql = "SELECT * FROM users WHERE name = '$name'";
```

```php
// Using prepared statements to prevent SQL injection
$name = "John";
$stmt = $pdo->prepare("SELECT * FROM users WHERE name = :name");
$stmt->execute(['name' => $name]);