What potential issues can arise when using ' ' to enclose checkbox values in an SQL query?

Using single quotes to enclose checkbox values in an SQL query can lead to SQL injection vulnerabilities if the values are not properly sanitized. To solve this issue, it is recommended to use prepared statements with parameterized queries to securely handle user input.

// Assuming $checkboxValue is the value from the checkbox
$stmt = $pdo->prepare("SELECT * FROM table WHERE column = :checkboxValue");
$stmt->bindParam(':checkboxValue', $checkboxValue, PDO::PARAM_STR);
$stmt->execute();