Welcome Guest, Not a member yet? Register   Sign In
how to code for sort and filter
#3

[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;
        }
    }
    
}
?>


Messages In This Thread
how to code for sort and filter - by El Forum - 12-02-2009, 04:23 PM
how to code for sort and filter - by El Forum - 12-02-2009, 08:06 PM
how to code for sort and filter - by El Forum - 12-03-2009, 05:48 AM
how to code for sort and filter - by El Forum - 12-03-2009, 07:03 AM
how to code for sort and filter - by El Forum - 12-03-2009, 08:04 PM
how to code for sort and filter - by El Forum - 12-03-2009, 08:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB