我无法将视图字符串插入数据库。我不完全确定是什么导致它,但这是我的代码;插入PHP和MySQL错误
$taskupdate = $db_new->prepare("INSERT INTO clients_tasks_updates (tid, sid, update, date, hours) VALUES (:tid, :sid, :update, :date, :hours)");
$taskupdate->execute(array(
':tid' => '1',
':sid' => '2',
':update' => 'Here is an update',
':date' => '01-01-2013',
':hours' => '50'
));
这是错误代码我得到:
Array ([0] => 42000 [1] => 1064 [2] => 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 'update, date, hours) VALUES ('1', '2', 'Here is an update', '01-01-2013', '50')' at line 1)
Task ID: 2
Staff ID: Scott
Update: Layout built for upcoming wordpress site.
Date: 22-10-2012
Hours: 6