} if (isset($_POST['parameter_update'])) { include "../dbconnect.php"; $parameter_id = $_POST['parameter_update']; $testid = $_POST['test_update_id']; $parameter_name = $_POST['parameter_name1']; $paramtype = $_POST['type1']; $paramunit = $_POST['unit1']; $paramformat = $_POST['format1']; $test_name = $_POST['test_name']; mysql_query("update wc_test set test_name ='{$test_name}' where test_id = {$testid} ") or die(mysql_error()); mysql_query("update wc_test_attribute set test_parameter_name ='{$parameter_name}',test_parameter_type ='{$paramtype}',test_parameter_unit='{$paramunit}',test_parameter_format ='{$paramformat}' where test_attribute_id = {$parameter_id} ") or die(mysql_error()); header('Location:../test.php?update=true'); } if (isset($_GET['gettestdata'])) { include "../dbconnect.php"; $testattrid = $_POST['id']; $sql = mysql_query("SELECT * FROM wc_test_attribute INNER JOIN wc_test ON wc_test_attribute.test_id = wc_test.test_id where test_attribute_id='{$testattrid}'") or die(mysql_error()); $res = mysql_fetch_assoc($sql); print json_encode($res); } if (isset($_GET['deletedata'])) { include "../dbconnect.php"; $test = new testfunction(); $test->testid = $_POST['delete_id']; if ($test->testdeletefunction()) { echo $_POST['delete_id']; } else { echo "error"; } }