Save dengan edit.php
<?php
$sambung = mysql_connect("localhost","root","") or die ("Gagal koneksi ke server");
mysql_select_db("master_barang") or die ("Gagal membuka Database");
$idbarang = $_GET['idbarang'];
$query = "select * from barang where idbarang='$idbarang'";
$result = mysql_query($query,$sambung) or die("Gagal melakukan query");
$buff = mysql_fetch_array($result);
mysql_close($sambung);
?>
<html>
<head><title><Edit Data </title></head>
<body>
<form name="form1" method="post" action="update.php">
<table>
<tr>
<td>ID Barang</td></tr>
<td><input type="text" name="idbarang" value="<?Php echo $buff['idbarang'];?>"></td></tr>
<tr>
<td>Nama Barang</td></tr>
<td><input type="text" name="namabarang" value="<?Php echo $buff['namabarang'];?>"></td></tr>
<tr>
<td>Jenis</td></tr>
<td><input type="text" name="jenis" value="<?Php echo $buff['jenis'];?>"></td></tr>
<tr>
<td>Satuan</td></tr>
<td><input type="text" name="satuan" value="<?Php echo $buff['satuan'];?>"></td></tr>
<tr>
<td>Keterangan</td></tr>
<td><input type="text" name="keterangan" value="<?Php echo $buff['keterangan'];?>"></td></tr>
<tr>
<input value="Simpan" type="submit" name="submit"/>
<input type="button" value="kembali" onClick="self.history.back()"></tr></tr>
</table>
</body>
</html>