PDOCrud Join operation

PDOCrud supports both left join and inner join operation. If you want to apply master, detail table operation where master table contains single record and details table contains multiple records, use LEFT JOIN else INNER JOIN.


Example of inner join 1
Example of inner join 2
  
                            $pdocrud = new PDOCrud();
                            $pdocrud->crudTableCol(array("first_name","last_name","user_name","gender"));
                            /**
                            * Add join between tables, supported join condition are "INNER JOIN" & "LEFT JOIN"
                            * @param   string  $joinTableName                             name of table to be joined
                            * @param   string  $joinCondition                             join condition e.g. ("table2.col = table1.col")
                            * @param   string  $joinType                                  type of join (Inner or left join)-default is inner join
                            * return   object                                             Object of class
                            */
                            $pdocrud->joinTable("user_meta", "user_meta.user_id = users.user_id", "LEFT JOIN");
                            echo $pdocrud->dbTable("users")->render();
                            

Users

Showing 1 to 10 of 128 entries

# User id First name Last name User name Gender Actions
1 32 hrlOCDmhryzBEsE WOTHCnFWkMtyfomjwc DrjxrIKjJG 0
2 34 oJNhBvgddZkQtCWGwbJ EwGQRgrMhpJPIN hpAlWtGWyNcQiWkyF aFWRRcQAdIVfYgAvY
3 35 SIziQniEASAco TunuIPurHXZWTgtc SXCumNDBFXUiryIcT KGzYsXVSfGdMRPixBlM
4 38 maxkjEXoUtlljICUryW SrzzMMOlmaDJgmyJ iUuxMTHtblSq bhPNYEOpXlgcuJ
5 39 zNVDdKmWtSmLSYBNkT VJsbnIvAJilkenhfHEF ASPAJHvEVgPyXvCJUK 0
6 40 BQccvGFs LRbyJbLdR yBTDPSWONDQkgGnwFeX 1
7 41 VdOkvBsUYPbigZ xTFHtDBMz TeMngNMK UQpITSjfOJmpkk
8 42 QXQOJwvOyGkalWSd YzNCbXWprWbN EMZWrDIjjsLBKdfEYZ 0
9 44 tcnCGtgMkdfKGwpSDBL tcEELJWEEogdlI GPinrSLqoxEI 1
10 45 tcnCGtgMkdfKGwpSDBL tcEELJWEEogdlI GPinrSLqoxEI 1
# User id First name Last name User name Gender Actions