Welcome Guest, Not a member yet? Register   Sign In
active record to get entire record of 2 tables
#1

[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 ?
#2

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




Theme © iAndrew 2016 - Forum software by © MyBB