Message :
Student
Showing 1 to 10 of 32 entries

PDOCrud allows the editing of related records of different table i.e. similar to nested table. Nested Table is a table inside a table. It is not stored in that way but similar concept is used. You can define relation between the two tables data using some binding column value.Please note that main tables must have fields present that are used for where condition to bind records. You need to enable $config["viewFormTabs"] = true; to make this work
//student table object $pStudent = new PDOCrud(); $pStudent->setSettings("viewFormTabs", true); $pStudent->multiTableRelationDisplay("tab", "Student"); //student's class object $pStudentClass = new PDOCrud(true); $pStudentClass->dbTable("class"); //first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name $pStudent->multiTableRelation("class_id", "class_id", $pStudentClass); $pStudentClass->multiTableRelationDisplay("tab", "Class"); //student's class object - adding one more table $pStudentTransport = new PDOCrud(true); $pStudentTransport->dbTable("vehicle"); //first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name $pStudent->multiTableRelation("transport_id", "vehicle_id", $pStudentTransport); $pStudentTransport->multiTableRelationDisplay("tab", "Vehicle"); $pStudentTransport->setSettings("viewFormTabs", true); //2nd level of nesting - relating section to class(first student to class and then class to section) $pStudentSection = new PDOCrud(true); $pStudentSection->dbTable("section"); //first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name $pStudentClass->multiTableRelation("class_id", "class_id", $pStudentSection); $pStudentSection->multiTableRelationDisplay("tab", "Section"); echo $pStudent->dbTable("student")->render();
Showing 1 to 10 of 32 entries