Multi table relation (nested tables) Editing of related records in other table (Added in v 2.0)

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. Click here for tab version

  
                            //class table object
                            $pClass = new PDOCrud();
                            //section of class 
                            $pSection = new PDOCrud(true);
                            $pSection->crudTableCol(array("name", "start_time", "end_time"));
                            $pSection->dbTable("section");
                            //first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name
                            $pClass->multiTableRelation("class_id", "class_id", $pSection);
                            //next level
                            //student's class object
                            $pStudent = new PDOCrud(true);
                            $pStudent->crudTableCol(array("first_name", "last_name", "gender"));
                            $pStudent->formFields(array("first_name", "last_name", "gender"));
                            $pStudent->dbTable("student");
                            //first paramater is first table(object) columnn name and 2nd parameter is 2nd object column name
                            $pSection->multiTableRelation("section_id", "section_id", $pStudent);

                            echo $pClass->dbTable("class")->render();
                        

Deprecated: Required parameter $field follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $task follows optional parameter $op in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Required parameter $totalrecords follows optional parameter $page in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrudHelper.php on line 191

Class

Showing 1 to 3 of 3 entries

# Class id Class name Code User id Actions
1 2 second 2 5
2 3 third 3 5
3 4 fourth 4 5
# Class id Class name Code User id Actions