[eluser]vincej[/eluser]
Hi ! I have a real simple query:
Code:
function getChild(){
$message="No Available Data"; /*Used in line 60*/
$id=$this->attribute('id');
$this->db->select('uri','id','title');
$this->db->where('parent_id',$id);
$Q = $this->db->get('default_pages');
if ($Q->num_rows() > 0){
foreach ($Q->result_array() as $row){
$child[] = $row;}
return var_dump($child);
}
else{return $message;}
}
For some bizaar reason which I can not pin point I am only getting the first value out - the "uri", ID and Title are missing.
Code:
array
0 =>
array
'uri' => string 'roofing/rubber/euroshake-heavy' (length=30)
However, if I remove URI from the select - I get ID ... the next one along. My gut feeling is that there is something wrong with the way I am formulating the result array. I have checked the CI guide - but can not see what I am doing wrong.
The data is there in the DB and the query is good - but what am I doing wrong with the array - I want all three values ?
Many Thanks !