使用Mysqli bind_param和日期和时间列? [英] Using Mysqli bind_param with date and time columns?
本文介绍了使用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();
这篇关于使用Mysqli bind_param和日期和时间列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文