[eluser]aussie1855[/eluser]
Thanks for the suggestion.
I have used the code as shown in the attachment and i have mark all as $query so that it passes the data from query to the next.
However it gives me the error message ' Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\CI\application\models\family_model.php on line 11 '
Any suggestions as to how to fix this? I have used print_r($query) and the problem seems to be the way i trying to get the data from the first query into the others as it does return a value after the first $query but not the others.
Thanks
Michael
Code:
<?php
class Family_model extends Model {
function getAll() {
$query = $this->db->get('users');
$query = $this->db->select('*');
$query = $this->db->group_by('surname');
$query = $this->db->order_by('surname','asc');
if($query->num_rows() > 0) {
foreach ($query->result() as $row) {
$data[] = $row;
}
return $data;
}
}
}
?>