我無法將視圖字符串插入數據庫。我不完全確定是什麼導致它,但這是我的代碼;插入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