balabolka中文语音库:为什么PHP无法让mysql修改时间?内详

来源:百度文库 编辑:高校问答 时间:2024/05/02 18:44:36
出现下面的错误提示,不知道措在那里,新记录可以插入时间,可是修改记录,更新时间就出现这个错误。我的时间格式没问题的: $now = date("Y-m-d H:i:s"); mysql我建立的是datetime格式。
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '02:38:47 where nickname = '55555'' at line 1

date函数的用法好像是这样大的
date("时间格式","unix时间戳")
比如
$time=time();//获取当前时间戳
$now=date("Y-m-d H:s:i",$time);
这个时候now 就是 2006-5-27 10:39:00 这样的