Deleting

ERROR: internal error, PDB structure with PDB ID ' . $parameter . ' not found in database!

'; die(); } $query = "DELETE FROM biomolecule WHERE id='$biomoleculeId';"; pg_exec($link, $query); $query = "SELECT id FROM biomoleculeData WHERE biomoleculeId='$biomoleculeId';"; $result = pg_exec($link, $query); $row = pg_fetch_row($result); $biomoleculeDataId = $row[0]; $query = "DELETE FROM biomoleculeData WHERE biomoleculeId='$biomoleculeId';"; pg_exec($link, $query); $query = "DELETE FROM methodNMRData WHERE biomoleculeDataId='$biomoleculeDataId';"; pg_exec($link, $query); $query = "DELETE FROM methodXRayData WHERE biomoleculeDataId='$biomoleculeDataId';"; pg_exec($link, $query); $query = "DELETE FROM customField WHERE biomoleculeId='$biomoleculeId';"; $query = "SELECT id FROM chain WHERE biomoleculeId='$biomoleculeId';"; $result = pg_exec($link, $query); while ($chainId = pg_fetch_row($result)){ $query2 = "SELECT id FROM residue WHERE chainId='" . $chainId[0] . "';"; $result2 = pg_exec($link, $query2); while ($residueId = pg_fetch_row($result2)){ $query = "DELETE FROM structureParameter WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM overlapArea WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM originMeanNormalVector WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM helicalParameter WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM stepClassification WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM C1GlobalParameter WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM torsionAngle WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM sugarConformationalParameter WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM pCVirtualBondDistance WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM helixRadiusRadialDisplacement WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM positionAndLocaHelicalAxisVector WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); $query = "DELETE FROM atom WHERE residueId='" . $residueId[0] . "';"; pg_exec($link, $query); } $query = "DELETE FROM residue WHERE chainId='" . $chainId[0] . "';"; pg_exec($link, $query); } $query = "DELETE FROM chain WHERE biomoleculeId='$biomoleculeId';"; pg_exec($link, $query); } ?>

All relevant records deleted.