I am failing mysql by recognizing the delete function
$code = '1234';
$conn = new PDO('mysql:host=localhost;dbname=data', 'root');
$stmt = $conn->prepare('SELECT * FROM codes WHERE code='.$code.'');
$stmt->execute();
$result = $stmt->fetchAll();
foreach($result as $row) {
extract($id);
$del = "DELETE FROM codes WHERE id = '".$id."'";
//$id é o id da coluna do BD
}
}