I’m new to php and have a school project where I need to make a form and database that will put out the data from said form. Right now my problem is that I can’t update the data inside even though it says that it’s connected to the data base
This is the php file that I’m using to edit the form I’m using
`<?php
include 'koneksi12A3_19.php';
if (isset($_POST['EDIT'])){
$ID = $_GET['ID'];
$hasilsql = "select * from tableedit_12a3_19 WHERE ID=$ID";
$tampil = mysqli_query($koneksi, "select * from tableedit_12a3_19 where ID='$ID'");
$hasil = mysqli_fetch_array($tampil);}{
?>
<html>
<head>
<title>Form Pengisian Data</title>
</head>
<body>
<div class="grid">
<div class="title">
</div>
<div class="header">
<h2><b>Form Edit Data</b></h2>
</div>
<div align=left class="content">
<form method="POST"action="update12A3_19.php">
<table border=0>
<tr>
<td>nama</td>
<td><input type="hidden" name="ID">
<input type="text" name="nama"></td>
</tr>
<tr>
<td>nomor</td>
<td>
<input type="text" name="nomor"></td>
</tr>
<tr>
<td>alamat</td>
<td><input type="textarea" name="alamat"></td>
</tr>
<tr>
<td>kota</td>
<td>
<input list="kota" name="kota" placeholder="Input kota" /></label>
<datalist id="kota">
<option value="Jakarta Barat">
<option value="Jakarta Timur">
<option value="Jakarta Utara">
<option value="Jakarta Selatan">
<option value="Jakarta Pusat">
<option value="Bekasi">
</datalist></td>
</tr>
<tr>
<td class="form-hobby">Hobby
</td>
<td>
<input type="radio" id="hobby" name="hobby" value="bulutangkis">
<label for="html">bulutangkis</label><br>
<input type="radio" id="hobby" name="hobby" value="basket">
<label for="css">basket</label><br>
<input type="radio" id="hobby" name="hobby" value="catur">
<label for="javascript">catur</label><br>
<input type="radio" id="hobby" name="hobby" value="sepak bola">
<label for="html">sepak bola</label><br>
<input type="radio" id="hobby" name="hobby" value="baca buku">
<label for="css">baca buku</label><br>
</td>
</tr>
<tr>
<td><input type="submit" value="EDIT"></td>
<td><input type="reset" value="CANCEL"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
<?php
}
?>`
and this is the update file that connects the file above with the database
`<?php
include_once("koneksi12A3_19.php");
if(isset($_POST["EDIT"]))
{
$ID = $_POST['ID'];
$nama = $_POST['nama'];
$nomor = $_POST['nomor'];
$alamat = $_POST['alamat'];
$kota = $_POST['kota'];
$hobby = $_POST['hobby'];
$query = "UPDATE tableedit_12a3_19 nama='$nama', nomor='$nomor', alamat='$alamat', kota='$kota', hobby='$hobby',
WHERE ID='$ID'";
mysqli_query($koneksi, $query);
header('location: tampilanedit12A3_19.php');
}
?>`
I tried putting isset into both the edit and update file because ID couldn’t be identified but now it won’t update the file
enter image description here I want to change the data inside a row like this