Welcome Guest, Not a member yet? Register   Sign In
Can you check my pagination?[SOLVED]
#6

(This post was last modified: 02-09-2017, 11:58 AM by Wouter60.)

In your controller, you first have $data['blog'] = ... to get all records from the blog via the model.
In the pagination part, you have $data['results'] = .... to get only the records for the specified page.
The foreach { } part in the view refers to $blog. That's why it shows all records, regardless of the pagination settings. Replace it with $results.
Besides that, don't loop through a foreach with foreach ($blog as $blog). Better is:
PHP Code:
Foreach($results as $result) {
 
 

$results: prural (is a collection of objects or arrays)
$result: single (is a single object or array)
Reply


Messages In This Thread
RE: Can you check my pagination? - by Wouter60 - 02-08-2017, 11:48 PM
RE: Can you check my pagination? - by kirasiris - 02-09-2017, 12:53 AM
RE: Can you check my pagination? - by Wouter60 - 02-09-2017, 05:42 AM
RE: Can you check my pagination? - by kirasiris - 02-09-2017, 06:12 AM
RE: Can you check my pagination? - by Wouter60 - 02-09-2017, 08:56 AM
RE: Can you check my pagination? - by kirasiris - 02-09-2017, 06:25 PM
RE: Can you check my pagination? - by Wouter60 - 02-09-2017, 11:40 PM
RE: Can you check my pagination? - by kirasiris - 02-10-2017, 12:50 PM
RE: Can you check my pagination? - by pdthinh - 02-10-2017, 10:01 PM
RE: Can you check my pagination? - by kirasiris - 02-10-2017, 10:46 PM
RE: Can you check my pagination? - by pdthinh - 02-10-2017, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB