hi there,
im using php4 with postgresql. I really need help on editing my script (below) to make sure it can insert data to table from multiple forms (3 form). I also not familiar with session variable and hidden value , therefore i really need a sample of script.
<?
include "./config.inc";
$link_id = db_connect($user_dbname);
$query = "INSERT INTO student_profile (stud_name,stud_ic,stud_iccolor,stud_birthdate,
stud_gender,stud_maritalstatus,stud_nationality,stud_race,stud_religion,
stud_bank_branch,stud_accountno)
values ('$name','$ic','$iccolor','$birthdate','$gender','$marital',
'$nationality','$race','$religion','$bbranch', '$accno')";
$result = pg_exec($link_id,$query);
if (!$result) {
echo "!!!!";
echo "$query\n";
$errormessage = pg_errormessage($link_id);
echo $errormessage;
exit;
}
echo "<center>All values were successfully inserted into database<center> ";
pg_close();
?>
* i would like to seperate it into 3 part which is 3 form difrrent pages.
example:
1st form: name,ic, ic color and birthdate
2nd form : gender , marital status, nationality and race
3rd form ; religion,bank branch and account number.
the submit button will be in page 3.
help please!
im using php4 with postgresql. I really need help on editing my script (below) to make sure it can insert data to table from multiple forms (3 form). I also not familiar with session variable and hidden value , therefore i really need a sample of script.
<?
include "./config.inc";
$link_id = db_connect($user_dbname);
$query = "INSERT INTO student_profile (stud_name,stud_ic,stud_iccolor,stud_birthdate,
stud_gender,stud_maritalstatus,stud_nationality,stud_race,stud_religion,
stud_bank_branch,stud_accountno)
values ('$name','$ic','$iccolor','$birthdate','$gender','$marital',
'$nationality','$race','$religion','$bbranch', '$accno')";
$result = pg_exec($link_id,$query);
if (!$result) {
echo "!!!!";
echo "$query\n";
$errormessage = pg_errormessage($link_id);
echo $errormessage;
exit;
}
echo "<center>All values were successfully inserted into database<center> ";
pg_close();
?>
* i would like to seperate it into 3 part which is 3 form difrrent pages.
example:
1st form: name,ic, ic color and birthdate
2nd form : gender , marital status, nationality and race
3rd form ; religion,bank branch and account number.
the submit button will be in page 3.
help please!