1

I have two models : Absence, Students;

Absence fetch name and absence number from Students, now i want to linking model together, but i have been struggling to figure out how to map those relationships,

i dont have groups table, cause works well before, but now cake php said error by not have linking model., i used this following line before and work fine!

    $this->loadModel("Student");
    $siswas=$this->Student->find('all');
    $this->set('students', $siswas);

but now i have error detected, named Internal server 500, and i don't know what i have to do., before my application is fine, but now is something wrong happens, now i need to linking model together, i need help for it..

any help would appreciated..

EDIT :

"My Problems has been Solved, the problem is because database is not working well thank for the answers"

4

1 回答 1

1

表结构将是:

Students Table
id    student_name   other fields

absents table
id  student_id  other fields

学生模特关系

$hasMany = array('Absent');

缺少模型关系

$belongsTo = array('Student');
于 2012-08-01T11:20:54.173 回答