Skip to content

Commit c6a63a3

Browse files
authored
Update delete.php
1 parent aaaaf56 commit c6a63a3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/delete.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
// Retrieve [id] value from querystring parameter
66
$id = $_GET['id'];
77

8-
// Delete row for a specified [id]
9-
$result = mysqli_query($mysqli, "DELETE FROM contacts WHERE id=$id");
8+
// Delete row for a specified id
9+
$stmt = $mysqli->prepare("DELETE FROM contacts WHERE id=?");
10+
$stmt->bind_param("i", $id);
11+
$stmt->execute();
1012

1113
// Redirect to home page (index.php)
1214
header("Location:index.php");
13-
?>
15+
?>

0 commit comments

Comments
 (0)