2016-11-18 119 views
0

我有一個事件表,這個字段:不保存在數據庫中的CakePHP數據

enter image description here

我使用此代碼在這個表中插入數據:

$oneEvent = array(
    'trainer_id' => $event['trainer_id'], 
    'formation_id' => $event['formation_id'], 
    'title' => $event['title'], 
    'start' => $event['start'][$i], 
    'end' => $event['end'][$i], 
); 
$success = $this->Event->save($oneEvent); 
$events_id= $this->Event->inserted_ids; 

當我運行這段代碼我知道插入元素的真實ID(使用調試顯示)

enter image description here

但在數據庫中我看不到這個領域從來沒有!!!!。 當我在phpmyadmin插入數據時,當這個請求INSERT INTO events(title,start, end, trainer_id, formation_id) VALUES ('Départ B','2016-11-18 10:00:00','2016-11-18 11:00:00','13','1')它工作 我不知道這裏發生了什麼!! ??

回答

0

我使用$dataSource->commit();解決了問題後調用save()函數