= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { $asset_id = $_POST['asset_id']; $asset_name = $_POST['asset_name']; $hostname = $_POST['hostname']; $assetclass_id = $_POST['assetclass_id']; $asset_info = $_POST['asset_info']; mysql_query("UPDATE asset SET asset_name='$asset_name', hostname='$hostname', assetclass_id='$assetclass_id', asset_info='$asset_info' WHERE asset_id='$asset_id'") or die(mysql_error()); header_location("assetview.php?asset_id=" . $asset_id); } $asset_id = $_GET['asset_id']; // get current information $result = mysql_query("SELECT asset_name, hostname, assetclass_id, asset_info FROM asset WHERE asset_id='$asset_id'"); while ($row = mysql_fetch_object($result)) { $asset_name = $row->asset_name; $hostname = $row->hostname; $assetclass_id = $row->assetclass_id; $asset_info = $row->asset_info; } ?>