使用Mysqli bind_param和日期和时间列?

问题描述:

如何使用PHP mysqli和bind_param将数据插入MySQL日期或时间列?

How do you insert data into a MySQL date or time column using PHP mysqli and bind_param?

与其他任何字符串一样

$stmt = $mysqli->prepare('insert into foo (dt) values (?)');
$dt = '2009-04-30 10:09:00';
$stmt->bind_param('s', $dt);
$stmt->execute();