I\'m trying to query the db with the following query in the model:
function showSpecific(){
$all = $this->session->all_userdata();
$name = $al
I think
$data['query'] = $this->db->query("...");
should be
$query=$this->db->query("...");
so you can
foreach ($query->result() as $row) {...}
reference: codeigniter
After question Update : You have $query variable inside your view because of $data['query'] ($data will be extracted), $query is your object now (inside your view) so you can loop the $query.
Wrong model name getMessages() has been called, it should be showSpecific()