Lot of mistakes in that code! (AND in the answers above as well!)
"
if(!empty($_POST['name']) and !empty($_POST['email']) and !empty($_POST['hotel']) and
!empty($_POST['interpreter_gender']) and !empty($_POST['date_request']) and !empty($_POST['comment']))
"
Get the $_POST variables into php variables with the same name (you will re-use them later:
$name = $_POST['name'];
$email = $_POST['email'];
$hotel = $_POST['hotel'];
$interpreter_gender = $_POST['interpreter_gender'];
$date_request = $_POST['date_request'];
$comment = $_POST['comment'];
... ADD here the OTHER $_POST values you will use in the next table (like "first-name" etc...)
Your test for empty: DON'T use "empty()".
if ( ($name != "") && ($hotel != "") && .... )
{
// now you can insert... OOPS! Your syntax is wrong.
// in Php, variables enclosed in SINGLE quotes are NOT parsed!
// in SQL, tables and field names must be eclosed in REVERSE SINGLE QUOTES. Values must be enclosed in SINGLE QUOTES.
$sql = "INSERT INTO `translator` (`name`, `email`, `hotel`, `interpreter_gender`, `date_request`, `comment`)
VALUES ('".$name."', '".$email."', '".$hotel."', '".$interpreter_gender."', '".$date_request."', '".$comment."')";
mysql_query($sql) or die (mysql_error());
}
(You also have a logic error: IF fields are not empty, $sql = "something;, then you are out of the IF, and do your mysql_query!
IF any field is empty, you do NOT define $sql, BUT you STILL call the query!!!)
NEXT: you record the booking:
"
$sql = "INSERT INTO booking ('first-name', 'surname', 'gender', 'birthday', 'country-city', 'contact-phone-number', 'email-address', 'select-hotel', 'check-in-date', 'check-out-date', 'no-of-night', 'no-of-room', 'no-of-adult'. 'no-of-children', 'occupancy', 'comment') VALUES ('$firstname', '$surname', '$gender', '$birthday', '$countrycity', '$contactphonenumber', '$emailaddress', '$selecthotel', '$checkindate', '$checkoutdate', '$noofroom', '$noofadult', '$noofchildren', '$occupancy', '$comment')";
"
1. replace your single quotes the way explained above
`tablename` - `fieldname` - ' " . $value . " '
2. Make sure you have extracted your edata from the $_POST (your code does not show that).
3. Rename your table fields: do NOT use "-", use "_"
'first-name' => first_name. This will avoid you to have confusions or parse error, later on: the "-" can be taken as a MINUS:
"update `table` set `score`=`score`-".CONSTANT." where ... "
Here, score is decremented by one. If you forgot your quotes, this would look like
score = score-constant => parse error!
Last note:
You store the value "$comment" in both tables, but I believe they MIGHT be two different variables!
If they are, call them comment1 and comment2 in your form.
Good luck!