Multi table relation in tabs (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.

  
                                //student table object
                                $pStudent = new PDOCrud();
                                $pStudent->multiTableRelationDisplay("tab", "Student");
                                //student's class object
                                $pStudentClass = new PDOCrud(true);
                                $pStudentClass->crudTableCol(array("class_id", "class_name", "code"));
                                $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");
                                //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");

                                $pStudent->crudTableCol(array("student_id","first_name","last_name"));//optional
                                echo $pStudent->dbTable("student")->render();
                        

Deprecated: Optional parameter $op declared before required parameter $task is implicitly treated as a required parameter in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 924

Deprecated: Creation of dynamic property PDOCrud::$langData is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2075

Deprecated: Optional parameter $page declared before required parameter $totalrecords is implicitly treated as a required parameter in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrudHelper.php on line 191

Deprecated: Creation of dynamic property PDOCrud::$langData is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2075

Deprecated: Creation of dynamic property PDOCrud::$langData is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2075

Deprecated: Creation of dynamic property PDOCrud::$langData is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2075

Deprecated: Creation of dynamic property PDOModel::$characterSet is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOModel.php on line 117

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOModel.php on line 964

Deprecated: Creation of dynamic property PDOModel::$characterSet is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOModel.php on line 117

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOModel.php on line 964

Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOModel.php on line 964

Deprecated: Creation of dynamic property PDOCrud::$dataHTML is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2139

Deprecated: Creation of dynamic property PDOCrud::$fieldList is deprecated in /home/javad/domains/javadfk.ir/public_html/pdocrud/script/classes/PDOCrud.php on line 2140

Student

Showing 1 to 5 of 12 entries

# Student id First name Last name Actions
1 1 Nitishassss Patil
2 2 vaishali patel
3 3 ankit patidar
4 4 x x
5 5 rahul verma
# Student id First name Last name Actions