Hi, Basically i will be running a competition i have a databse setup with two tables.
One called details (of user who entered)
The othere entries (of answers to questions)
Now i want some of the form parts to goto one table the other to the opther (if you know what imean)
The code i am trying is below though i think i got the syntazing wrong maybe?
(Also as a sidenote, when teh data goes into the dbase a primary key is established to give each record a number, is there any way of ensuring record #1 of both tables came from the same submitted form?) -> and as a double check to get the email data submitted to BOTH tables?
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "USER", "Passwordl");
mysql_select_db("DB NAME",$db);
$sql = "INSERT INTO entries (q1,q2,q3,q4,q5,q6) VALUES ('$q1','$q2','$q3','$q4','$q5','$q6'),
INSERT INTO details (title,first,last,country,email) VALUES ('$title','$first','$last','$country','$email')";
$result = mysql_query($sql);
echo "Thank you for entering the Competition..\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Q1<input type="Text" name="q1"><br>
Q2<input type="Text" name="q2"><br>
Q3<input type="Text" name="q3"><br>
Q4<input type="Text" name="q4"><br>
Q5<input type="Text" name="q5"><br>
Q6<input type="Text" name="q6"><br>
Title<input type="Text" name="title"><br>
First name:<input type="Text" name="first"><br>
Last name:<input type="Text" name="last"><br>
Country:<input type="Text" name="country"><br>
Email Address<input type="Text" name="email"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>