[eluser]johnmiller[/eluser]
Hey...
I have a table called 'users' with fields 'name, address'.
There are 100 records in this table.
I need to display all the 100 records in the 'view'.
But I am getting only one record(first record).
How to write the view which displays all the 100 records?
Can you please help me?
The below given are the model and controller
Model (blogmodel.php)
Code:
<?php
class Blogmodel extends Model {
function select_entries()
{
$this->db->select('name, address');
$query = $this->db->get('users');
return $query->row_array();
}
}
?>
Controller (blog.php)
Code:
<?php
class Blog Extends Controller {
function index()
{
$this->load->model('blogmodel');
$data['query'] = $this->blogmodel->select_entries();
$this->load->view('blogview', $data);
}
}
?>