0
I have the following select :
$this->db->select('*');
$this->db->from('tbl_produto_marca');
$this->db->join('tbl_produto', 'tbl_produto_marca.cd_codigo = tbl_produto.cd_marca');
$this->db->where('tbl_produto.cd_codigo', $cd_codigo);
$query = $this->db->get()->row();
foreach ($query as $key) {
echo $key; //assim está trazendo o cd_codigo e o ds_marca em seguida.
}
I would like to show the data of tbl_product, which has two columns: cd_code and ds_brand. If I try
echo $key->ds_marca
The following error occurs: Trying to get Property of non-object
What am I doing wrong? My select? the way I show?
tries to change $this->db->get()->Row(); to $this->db->get()->result();
– Marcelo Diniz
I believe they’ve answered that here, see
– Danilo
You could var_dump the query variable to know the result?
– Mauricio Wanderley Martins