Forum Moderators: coopster
<?php
$con = mysql_connect("*","*","*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("**", $con);
$sql="INSERT INTO contactdetails (Name,Surname,Number,Email,MovingFrom,MovingTo,Date)
VALUES ('$_POST[Name]','$_POST[Surname]','$_POST[Number]','$_POST[Email]','$_POST[MovingFrom]','$_POST[MovingTo]','$_POST[Date]')";
$sql="INSERT INTO destination (CurrentPremises,CurrentFloor,DestinationPremises,DestinationFloor,WrapEverything,Unpack,Hangerpack,SendMaterials,InsureEverything)
VALUES ('$_POST[CurrentPremises]','$_POST[CurrentFloor]','$_POST[DestinationPremises]','$_POST[CurrentFloor]','$_POST[WrapEverything]','$_POST[Unpack]','$_POST[Hangerpack]','$_POST[SendMaterials]','$_POST[InsureEverything]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
ob_start();
header("Location: email.php");
ob_end_flush();
exit;
?>
mysql_select_db("*****", $con); <- tells it which database $sql="INSERT INTO *****(Name,Surname,Number,Email,MovingFrom,MovingTo,Date) <-Tells it which table to insert to VALUES ('$_POST[Name]','$_POST[Surname]','$_POST[Number]','$_POST[Email]','$_POST[MovingFrom]','$_POST[MovingTo]','$_POST[Date]')";, <-Tells it what data to enter into which field on the table.
$sql="INSERT INTO contactdetails (Name,Surname,Number,Email,MovingFrom,MovingTo,Date)
VALUES ('$_POST[Name]','$_POST[Surname]','$_POST[Number]','$_POST[Email]','$_POST[MovingFrom]','$_POST[MovingTo]','$_POST[Date]')";
$sql="INSERT INTO destination (CurrentPremises,CurrentFloor,DestinationPremises,DestinationFloor,WrapEverything,Unpack,Hangerpack,SendMaterials,InsureEverything)
VALUES ('$_POST[CurrentPremises]','$_POST[CurrentFloor]','$_POST[DestinationPremises]','$_POST[CurrentFloor]','$_POST[WrapEverything]','$_POST[Unpack]','$_POST[Hangerpack]','$_POST[SendMaterials]','$_POST[InsureEverything]')";