Hi, iam trying to insert values in the child table, with condition that both pk and fk should match,
pk = stud_id and fk dstud_id.
here is what iam trying
pk = stud_id and fk dstud_id.
here is what iam trying
Code:
include('config.php');
if (isset($_GET['stud_id']) ) {
$id = (int) $_GET['stud_id'];
if (isset($_POST['submitted'])) {
foreach($_POST AS $key => $value) { $_POST[$key] = mysql_real_escape_string($value); }
$sql = "INSERT INTO `cjet`.`student_don_reg_history` (`stud_full_name`,`course_place`,`course_year`,
`course_name`,`stud_reg_no`,`don_amt`,`dd_no`)
VALUES('{$_POST['stud_full_name']}','{$_POST['place']}',
'{$_POST['year']}','{$_POST['course']}','{$_POST['stud_reg']}',
'{$_POST['don_amt']}','{$_POST['dd_no']}')WHERE `dstud_id` = '$id' ";
mysql_query($sql) or die(mysql_error());
Comment