Welcome Guest, Not a member yet? Register   Sign In
pagination doesn't work
#4

(03-22-2015, 01:24 AM)chouwech Wrote: hi now this is new error:

Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: result
Filename: users/index.php
Line Number: 43

P.S. after setting up pagination library in controller, the foreach doesn't have any problem and show data in table.

Hi. Does your last line mean that you solved your problem? If not, try using a var_dump to see what is in the array that you pass. If you are using
$this->template->load('users/index', array('users' => $data)); in your controller
then put in your view something like this
Code:
var_dump($users);
exit;
<?php foreach($users as $key => $value):?>

Also, $this->template->load is not documented for CI 2 or CI 3. The documentation refers to $this->template->parse. Are you using a third-party library of some kind? I'm just curious because using that is not giving you an error.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply


Messages In This Thread
pagination doesn't work - by chouwech - 03-21-2015, 11:39 AM
RE: pagination doesn't work - by RobertSF - 03-21-2015, 08:34 PM
RE: pagination doesn't work - by chouwech - 03-22-2015, 01:24 AM
RE: pagination doesn't work - by RobertSF - 03-22-2015, 07:49 AM
RE: pagination doesn't work - by chouwech - 03-22-2015, 10:22 AM
RE: pagination doesn't work - by RobertSF - 03-22-2015, 11:55 AM
RE: pagination doesn't work - by chouwech - 03-22-2015, 01:18 PM
RE: pagination doesn't work - by phoenixcoded - 03-25-2015, 05:43 AM
RE: pagination doesn't work - by RobertSF - 03-25-2015, 07:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB