谢谢你的期待.所有有用的答案/评论都已经过投票.
在php中,您可以像这样使用NOW():
mysql_query("INSERT INTO tablename (id, value, time_created)
VALUES ('{$id}', '{$value}', NOW())");
Run Code Online (Sandbox Code Playgroud)
我怎么能在PDO中做同样的事情.当我像这样绑定时,我收到一个错误:
$stmt->bindParam(':time_added', NOW(), PDO::PARAM_STR);
Run Code Online (Sandbox Code Playgroud)
它是PDO:PARAM_STR?