From c54617b28750cc07b0bb43601f119cd69725ad6d Mon Sep 17 00:00:00 2001 From: elhaddaji_Otmane <76048466+otmaneelhaddaji@users.noreply.github.com> Date: Thu, 23 Jun 2022 18:01:45 +0100 Subject: [PATCH 1/4] Delete db.php --- db.php | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 db.php diff --git a/db.php b/db.php deleted file mode 100644 index 5504577..0000000 --- a/db.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file From b9f7e00f6e2109fa14e5ee1549cdd5bf9f1e9d23 Mon Sep 17 00:00:00 2001 From: elhaddaji_Otmane <76048466+otmaneelhaddaji@users.noreply.github.com> Date: Fri, 24 Jun 2022 20:22:50 +0100 Subject: [PATCH 2/4] Create db.php --- db.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 db.php diff --git a/db.php b/db.php new file mode 100644 index 0000000..3666d39 --- /dev/null +++ b/db.php @@ -0,0 +1,8 @@ + Date: Fri, 24 Jun 2022 20:22:52 +0100 Subject: [PATCH 3/4] Update delete.php --- delete.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/delete.php b/delete.php index c9ccd65..6f73127 100644 --- a/delete.php +++ b/delete.php @@ -4,7 +4,9 @@ } $id = $_GET['id']; include("db.php"); -$result = mysqli_query($mysqli, "DELETE FROM etudiant WHERE id=$id"); +$result = $mysqli->prepare("DELETE FROM etudiant WHERE id={$id}"); +$result->execute([":id",$id]); header("Location:index.php"); + ?> From 66809747b3d605ec86cc2e721566080a6d874b30 Mon Sep 17 00:00:00 2001 From: elhaddaji_Otmane <76048466+otmaneelhaddaji@users.noreply.github.com> Date: Fri, 24 Jun 2022 20:22:55 +0100 Subject: [PATCH 4/4] Update index.php --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 0224801..d78dc6e 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ if (isset($_REQUEST['search'])) { $serch = $_GET['search']; } -$result = mysqli_query($mysqli, "SELECT * FROM `etudiant` WHERE `email` LIKE '%$serch%'"); +$result =$mysqli->query("SELECT * FROM `etudiant` WHERE `email` LIKE '%$serch%'"); require "header.php"; ?>