我对此有疑问。我正在尝试使这些字段组合在一起,一个带有 - 一个不插入到数据库中
$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);
}
}
?>