Combining fields to insert into databse
I am having issues with this. I am trying to make it so these fields
combine, one with - and one without to insert into a database
$daters = $_POST['11']." ". $_POST['22']." ". $_POST['33'];
$dater = $_POST['11']." - ". $_POST['22']." - ". $_POST['33'];
<?php
// if ('POST' === $_SERVER['REQUEST_METHOD'])
if (isset($_POST['submit2']))
{
$con = mysql_connect("localhost","rabbitju_rjziond","r4bb1t");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("rabbitju_rjreservation", $con);
$daters = $_POST['11']." ". $_POST['22']." ". $_POST['33'];
$dater = $_POST['11']." - ". $_POST['22']." - ". $_POST['33'];
//Writes the to the server
$sql = mysql_query("INSERT INTO `reservation__date` (`reservation_id`,
`reservation_date`)
VALUES
('daters', '$dates')") or die(mysql_error());
$query = mysql_query($sql);
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
echo "Succesfully added transaction. Updating table...";
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"6\">";
mysql_close($con);
}
}
?>
No comments:
Post a Comment