i create a curd apllication with the help of php and mysql there is work all operation insert, read and delete but in update option it not work. when i click on update button it is jump directly on display.php page.
this is my display.php code
<?php
include 'conc.php';
// $username = $_POST["username"];
// $password = $_POST["password"];
$q = "select * from cued_data";
$query = mysqli_query($con , $q);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>display data</title>
<link rel="stylesheet" href="curd.css">
</head>
<body>
<div class="container">
<h1>display Table Data</h1>
<table class="table">
<tr>
<th>Id</th>
<th>Username</th>
<th>Password</th>
<th>Delete</th>
<th>Update</th>
</tr>
<?php
include 'conc.php';
$q = "select * from cued_data";
$query = mysqli_query($con , $q);
while($res = mysqli_fetch_array($query)){
?>
<tr>
<td> <?php echo $res['id']; ?> </td>
<td> <?php echo $res['name']; ?> </td>
<td> <?php echo $res['password']; ?> </td>
<td><button class="dlt"> <a href="delete.php?id= <?php echo $res['id']; ?>" > Delete: </a> </button> </td>
<td><button class="dlt"> <a href="update.html?id= <?php echo $res['id']; ?>" > Update: </a> </button> </td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>
this is my update.php file
<?php
include "conc.php";
include "display.php";
$id = $_GET["id"]; # i think error in this section
$username = $_POST["name"];
$password = $_POST["password"];
// $q = "delete from `cued_data` where id = $id" ;
$msql= " update cued_data set id ='$id', name = '$username', password = '$password' where id = '$id' ";
$query = mysqli_query($con, $msql);
header("location:display.php");
?>
this is my delete.php file
<?php
include "conc.php";
$id = $_GET["id"];
$q = "delete from `cued_data` where id = $id" ;
$query = mysqli_query($con, $q);
header("location:display.php");
?>