prepare($query); $res = $sth->execute(); $numRows = $sth->rows(); for ($i=0; $i < $numRows; $i++) { $result = $sth->fetchrow_hash(); $portid = $result["id"]; $query = "DELETE FROM networking_wire WHERE end1='$portid' OR end2='$portid'"; $count = $adb->dbh_do($query); } $query = "DELETE FROM networking WHERE (ID = \"$ID\")"; $count = $adb->dbh_do($query); $query = "DELETE FROM networking_ports WHERE (device_on = \"$ID\" AND device_type = 2)"; $count = $adb->dbh_do($query); header("Location: http://$SERVER_NAME/$USERPREFIX/networking/"); ?>