我正在使用jQuery的datetimepicker,当我从datetimepicker中选择一个日期时,它将它放在以下格式中:
11/10/2011 14:02
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试将它插入我的sql表中时,就像这样
INSERT INTO MYTABLE (date, name) values ('$_POST[datepicker]','$_POST[name]')
Run Code Online (Sandbox Code Playgroud)
它说日期格式不正确.
有人可以帮我确定如何格式化这样的日期,以便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 '14:33:00,1,2,'Y')' at line 2
$datetosave = date("Y-m-d H:i:s", strtotime($_POST[date]));
$insert_q = "INSERT INTO reservations (res_date, res_numofseats, user_id, rsvp)
VALUES ($datetosave,$_POST[cars],2,'Y')";
Run Code Online (Sandbox Code Playgroud) 我有一个使用"试图使用"的小程序#include <queue>.我使用Ubuntu操作系统,但它说:
fatal error: queue: No such file or directory
Run Code Online (Sandbox Code Playgroud)
任何想法为什么,或我需要做些什么来使它工作?
#include <queue>
using namespace std;
int main()
{
queue<int> Q;
Q.push( 1 );
Q.push( 2 );
Q.push( 3 );
cout << Q.front();
Q.pop();
cout << Q.front();
Q.pop();
cout << Q.front();
Q.pop();
return 0;
}
Run Code Online (Sandbox Code Playgroud)