这样我试过,数据不能插入提示错误:
#1064 - 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 '09:32:53)' at line 1
而且时间是比当前时间晚8个小时的。
$date = date('Y-m-d H:i:s');
$sql = "insert into tablename (createdt) value ('$date';)";
=================
我少写了个括号, 获取时间之前设置一下PHP时区就可以了.
$sql = "insert into tablename (createdt) value (NOW());"
这样吧.直接用mysql的时间
这个也试过了,是不是现在不支持NOW()函数?提示错误:
Fatal error: Call to undefined function NOW()
兄弟.. Fatal error: Call to undefined function NOW() 这个提示是php的吧.. 那个NOW() 是sql 语句
追问哦,了然,Thank you very much~~~
Besides, I'm a girl ! Thank you!!!