title: getting data from 2 different table with JOIN sql. Codeigniter
body: <p>I use codeigniter, and I need to get data from 2 different table. for now it returns data only from works_image table. how can I get data from both 2 table ? </p>
  
  <p>thanks a lot!!</p>
  
  <pre>
  $this->db->select('works_image.*', 'works.*');
  $this->db->from('works_image', 'works');
  $this->db->join('works', 'works.id = works_image.id_work');
  $result = $this->db->get();
  
  foreach ($result->result() as $row) {
      echo " # " . $row->id . " - " . $row->thumb . " - " . $row->wname . "<br />";
  } 
  </pre>