title: mysql join query from 3 tables
body: <p>i want to the join query from three table 1 tbl_customerinfo , 2 tbl_customerinfo ,3- tbl_cust_ext_pref;</p>
  
  <p>i want add to table 3( tbl_cust_ext_pref ) in this query ..</p>
  
  <p>i have using join query from two table and get all informations and code is working a- tbl_customerinfo feild name ( id ,c_shortcode, c_type)</p>
  
  <p>b - tbl_cust_extinfo</p>
  
  <p>feild name ( cx_id ,cx_gender,cs_createdby)</p>
  
  <p>i have use this code</p>
  
  <p>/* code here */</p>
  
  <pre><code>$this-&gt;db-&gt;select ( this is a table
  
                    'tbl_customerinfo.c_id,
                    tbl_customerinfo.c_shortcode,
                     tbl_customerinfo.c_type,
  
  /*this is b table tbl_cust_extinfo.cx_id, tbl_cust_extinfo.cx_gender, tbl_cust_extinfo.cs_createdby*/
  
                       ');
  
             $this-&gt;db-&gt;from('tbl_customerinfo');
         $this-&gt;db-&gt;join
         (
          'tbl_cust_extinfo', 
          'tbl_customerinfo.c_id = tbl_cust_extinfo.cx_id'
  
          );
  
          $query = $this-&gt;db-&gt;get();
  //$info='tbl_customerinfo';
  if($query-&gt;num_rows() &gt; 0)
  {
  
      foreach ($query-&gt;result() as $row)
      {
          //print_r($row);
          //exit();
  
  
          $info[] = array(
                           'c_id' =&gt; $row-&gt;c_id,
                           'c_shortcode' =&gt; $row-&gt;c_shortcode,
                           'c_type'=&gt; $row-&gt;c_type
  
  
                           array(
  
                                   'cx_id'=&gt; $row-&gt; cx_id,
                                   'cx_gender'=&gt; $row -&gt; cx_gender);
  </code></pre>