仅通过添加日期和时间插入mysql日期时间和日期时间

时间:2013-12-30 07:59:06

标签: php mysql date datetime time

我有以下问题:

$date = $_POST["date"];

$time = $_POST["time"];

$date $time = $_POST["datetime"];

$datetime = "$date $time";

$datetime = $_POST["datetime"];

如何将其插入3行?

1 个答案:

答案 0 :(得分:0)

使用连接运算符 . 来实现此目的。

$date = $_POST["date"];
$time = $_POST["time"];
$datetime = $date.$time; // Your date and time is concatenated into $datetime variable.