Welcome Guest, Not a member yet? Register   Sign In
how to showing specific information from database in a list..
#1

[eluser]Unknown[/eluser]
del
#2

[eluser]jprateragg[/eluser]
How exactly do you have this setup right now? Do you have any of this working in CI? For starters, you can't use $this->load->view() in a view, nor can you use $query->result in a view. What are you view files? Have you read the CI documentation?

1. This is a simple looping issue. In your index controller, you need to have a query that only fetches the first 4 rows. Then in your read more page, have a new query that fetches 8 (or whatever) rows. You can format it via PHP or through CSS to limit the number of columns. In PHP you could use:

Code:
if ($counter % 4 == 0) {
   echo '</tr>';
}

Once you get to 4 columns. Just make sure your counter variable starts at 1.

2. You need to create an album view controller:

Code:
public function viewalbum($id) {
    $query = $this->db->query("SELECT * FROM albums WHERE id = $id");
    $data['album_details'] = $query->result_array();
    ...
    $this->load->view('header', $data);
    $this->load->view('viewalbum_page', $data);
    $this->load->view('footer', $data);
    ...
}




Theme © iAndrew 2016 - Forum software by © MyBB