This 3 file are related , when i run it ,i dont know why it cannot update into my database.Can somebody give me a help to check it out please?
fisrst file Information.php :
if (isset($GET['id'])) {
require("config.php");
// if yes: remove harmful tags and save the passed id in variable $id
$id = strip_tags($GET['id']);
require("config.php");
$sql = mysql_query("SELECT *FROM listofitem WHERE ID='$id'");
$rows=mysql_fetch_array($sql);
echo "<tr><td>Nama Peralatan</th>
echo"<tr><td>{$rows['NamaPeralatan']}</td>
else {
echo "Id was not passed to this routine";
die;
}
echo"<td><a href='update.php?id={$rows['ID']}'>update</a></td>";
?>
second file is: update.php
<?php
require("config.php");
$sql="SELECT * FROM listofitem WHERE ID='$id'";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
?>
<td align="center"><strong>NamaPeralatan</strong></td>
<td align="center"><input name="NamaPeralatan" type="text" id="NamaPeralatan" value="<? echo $rows['NamaPeralatan']; ?>"></td>
<td><input name="id" type="hidden" id="id" value="<? echo $rows['id']; >"></td>
<td align="center"><input type="submit" name="Submit" value="Submit"></td>
third file is: update_ac.php
require("config.php");
$sql="UPDATE listofitem SET NamaPeralatan='$NamaPeralatan' WHERE id='$id'";
$result=mysql_query($sql);