CodeIgniter Forums
active record to get entire record of 2 tables - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: active record to get entire record of 2 tables (/showthread.php?tid=55219)



active record to get entire record of 2 tables - El Forum - 10-15-2012

[eluser]nencor[/eluser]
i have tables like this picture and i want to get the entire record of 2 tables, so i use the following code
Code:
$this->db->select('*');
        $this->db->from('ms_Kategori_Material','ms_Material_Jasa'); // full table name
        $this->db->join('ms_Material_Jasa', 'ms_Kategori_Material.Kode_Kategori_Material_Jasa = ms_Material_Jasa.Kode_Kategori_Material_Jasa');
        $table = $this->db->get();
        print_r($table->result_array()); //display raw sql

in my model, that print_r() is not showing the Kode_Material_Jasa values. what makes the Kode_Material_Jasa is not displayed ?


active record to get entire record of 2 tables - El Forum - 10-15-2012

[eluser]CroNiX[/eluser]
In your image, Ms_Kategori_Material and Ms_Material_Jasa both have the M in Ms_ capitalized.