Cakephp1 という名前のデータベースに、tasks という名前のテーブルがあります。コントローラーに次のコードを記述しました。
function edit($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid Task');
$this->redirect(array('action'=>'index'), null, true);
}
if (empty($this->data)) {
$this->data = $this->Task->find(array('id' => $id));
} else {
if ($this->Task->updateAll(debug($this->data))){
$this->Session->setFlash('The Task has been saved');
$this->redirect(array('action'=>'index'), null, true);
} else {
$this->Session->setFlash('The Task could not be saved.
Please, try again.');
}
}
}
私はcakephpが初めてで、これは私が試している私の例です。私を助けてください。列を更新するにはどうすればよいですか?