在Cloud9中使用MySQL日期时间格式有问题。
MySQL引用声明日期时间格式是YYYY DD:MM:SS,这就是我所做的,但是它一直给我一个关于日期时间格式的语法错误。
我得到的错误是:
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 '. '2018-05-01 12:12:12')' at line 2我的JavaScript代码(部分):
result = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
var login = document.getElementById('login');
login.value=result;MySQL代码:
$sql = "INSERT INTO Customer(customer_id, first_name, last_name, email, phone_home, phone_mobile, user_type_id, password, pasword_hashed, login)
VALUES ('', '$first_name', '$last_name', '$email', '$phone_home', '$phone_mobile', '$user_type_id', '$password', '$password_hashed'. '$login')";发布于 2018-05-23 12:46:14
你有“。”查询中丢失:
'$password_hashed'. '$login'您可能需要逗号(,)。
'$password_hashed', '$login'发布于 2018-05-23 12:45:31
修好了。这简直就是"$password_hashed'. '$login'“的句号。啊啊!
https://stackoverflow.com/questions/50488718
复制相似问题