Mochachinoca459
01-25-2007, 10:03 AM
Hi all
I have a problem inserting value into the database. When I click the submit button on a preview page, it goes to insert.php where a record is added into the database but the fields are blank. Below are the codes for insert.php:
<?php
$person = $_REQUEST["person"];
$venue1 = $_REQUEST["venue1"];
$venue2 = $_REQUEST["venue2"];
$venue3 = $_REQUEST["venue3"];
$day1 = $_REQUEST["day1"];
$day2 = $_REQUEST["day2"];
$day3 = $_REQUEST["day3"];
$timeslot1 = $_REQUEST["timeslot1"];
$timeslot2 = $_REQUEST["timeslot2"];
$timeslot3 = $_REQUEST["timeslot3"];
$childName = $_REQUEST["childName"];
$nationality = $_REQUEST["nationality"];
$sex = $_REQUEST["sex"];
$race = $_REQUEST["race"];
$religion = $_REQUEST["religion"];
$homeAddress = $_REQUEST ["homeAddress"];
$correspondingAddress = $_REQUEST ["correspondingAddress"];
$postCode = $_REQUEST ["postCode"];
$areaCode = $_REQUEST ["areaCode"];
$telNo = $_REQUEST ['telNo'];
$language = $_REQUEST ['language'];
$birthcertNo = $_REQUEST ['birthcertNo'];
$dy = $_REQUEST ['birthDate'];
$mo = $_REQUEST ['birthMonth'];
$yr = $_REQUEST ['birthYear'];
$siblings = $_REQUEST ['siblings'];
$preschoolDate = $_REQUEST ['preschoolDate'];
$preschoolName = $_REQUEST ['preschoolName'];
$pastillness = $_REQUEST ['pastIllness'];
$checkOne = $_REQUEST ['declaration'];
$handicaps = $_REQUEST ['handicaps'];
?>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("euusers", $con);
if(isset($_REQUEST['Submit'])) {
$sql="INSERT INTO tbl_euusers (person, venue1, venue2, venue3, day1, day2, day3, timeslot1, timeslot2, timeslot3,childName, nationality, sex, race, religion, homeAddress, correspondingAddress, postCode, areacode, telNo, language, birthcertNo, birthDate, birthMonth, birthYear, siblings, preschoolDate, preschoolName, pastIllness, declaration, handicaps)
VALUES('$_REQUEST[person]','$venue1','$venue2','$venue3','$day1','$day2','$day3','$timeslot1','$timeslot2','$timeslot3','$chi ldName','$nationality','$sex','$race','$religion','$homeAddress',
'$correspondingAddress','$postCode','$areaCode','$telNo','$language', '$birthcertNo','$dy','$mo','$yr','$siblings','$preschoolDate', '$preschoolName', '$pastillness', '$checkOne','$handicaps')";
$result = mysql_query($sql,$con);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
else
{
echo 'Data has been input into the database';
}
mysql_close();
}
?>
Could anyone try to help me please?
Thanks
Mocha
I have a problem inserting value into the database. When I click the submit button on a preview page, it goes to insert.php where a record is added into the database but the fields are blank. Below are the codes for insert.php:
<?php
$person = $_REQUEST["person"];
$venue1 = $_REQUEST["venue1"];
$venue2 = $_REQUEST["venue2"];
$venue3 = $_REQUEST["venue3"];
$day1 = $_REQUEST["day1"];
$day2 = $_REQUEST["day2"];
$day3 = $_REQUEST["day3"];
$timeslot1 = $_REQUEST["timeslot1"];
$timeslot2 = $_REQUEST["timeslot2"];
$timeslot3 = $_REQUEST["timeslot3"];
$childName = $_REQUEST["childName"];
$nationality = $_REQUEST["nationality"];
$sex = $_REQUEST["sex"];
$race = $_REQUEST["race"];
$religion = $_REQUEST["religion"];
$homeAddress = $_REQUEST ["homeAddress"];
$correspondingAddress = $_REQUEST ["correspondingAddress"];
$postCode = $_REQUEST ["postCode"];
$areaCode = $_REQUEST ["areaCode"];
$telNo = $_REQUEST ['telNo'];
$language = $_REQUEST ['language'];
$birthcertNo = $_REQUEST ['birthcertNo'];
$dy = $_REQUEST ['birthDate'];
$mo = $_REQUEST ['birthMonth'];
$yr = $_REQUEST ['birthYear'];
$siblings = $_REQUEST ['siblings'];
$preschoolDate = $_REQUEST ['preschoolDate'];
$preschoolName = $_REQUEST ['preschoolName'];
$pastillness = $_REQUEST ['pastIllness'];
$checkOne = $_REQUEST ['declaration'];
$handicaps = $_REQUEST ['handicaps'];
?>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("euusers", $con);
if(isset($_REQUEST['Submit'])) {
$sql="INSERT INTO tbl_euusers (person, venue1, venue2, venue3, day1, day2, day3, timeslot1, timeslot2, timeslot3,childName, nationality, sex, race, religion, homeAddress, correspondingAddress, postCode, areacode, telNo, language, birthcertNo, birthDate, birthMonth, birthYear, siblings, preschoolDate, preschoolName, pastIllness, declaration, handicaps)
VALUES('$_REQUEST[person]','$venue1','$venue2','$venue3','$day1','$day2','$day3','$timeslot1','$timeslot2','$timeslot3','$chi ldName','$nationality','$sex','$race','$religion','$homeAddress',
'$correspondingAddress','$postCode','$areaCode','$telNo','$language', '$birthcertNo','$dy','$mo','$yr','$siblings','$preschoolDate', '$preschoolName', '$pastillness', '$checkOne','$handicaps')";
$result = mysql_query($sql,$con);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
else
{
echo 'Data has been input into the database';
}
mysql_close();
}
?>
Could anyone try to help me please?
Thanks
Mocha