1
私はCakePHPでアプリケーションを持っているので、テーブルにデータ行を挿入する必要があります。私はCakePHPの本のチュートリアルに従ってきましたが、うまくいきません。私はcreate()
メソッドを使用している新しい行にデータを保存する
$this->Temporary->create();
$this->Temporary->set(
array(
'Temporary.position_id'=>$employeesAttribute[$arrCount][0]['EmployeeAttribute']['position_id'],
'Temporary.person_id'=>$employeesAttribute[$arrCount][0]['StatusEmployee']['person_id'],
'Temporary.job_id'=>$employeesAttribute[$arrCount][0]['Job']['id'],
'Temporary.unit_id'=>$employeesAttribute[$arrCount][0]['Unit']['id'],
'Temporary.person_code'=>$employeesAttribute[$arrCount][0]['StatusEmployee']['code'],
'Temporary.name'=>$employeesAttribute[$arrCount][0]['Person']['first_name'].' '.$employeesAttribute[$arrCount][0]['Person']['middle_name'].' '.$employeesAttribute[$arrCount][0]['Person']['last_name'],
'Temporary.job'=>$employeesAttribute[$arrCount][0]['Job']['short_desc']
)
);
$this->Temporary->save();
は、変数を設定し、保存する方法を呼び出しますが、このコードは私のテーブルにデータを保存しません。このコードで何が問題になっていますか?
保存後に 'var_dump($ this-> Temporary-> invalidFields());'を試してください。 – deceze
結果は同じですが、データをテーブルに保存しません。答えに感謝します。 – user1290932
これはちょうどあなたを助けることになっています*デバッグ* ... – deceze