Pagination and table error. |
[eluser]ede196620[/eluser]
So i have functions view update and delete. Update and delete works as it suppose to but the view function dose not perform as it suppose to fore some reason it keeps trowing me these 2 errors Code: A PHP Error was encountered i cant figure out i looked at all of my code 100 times and cant find where i went wrong maybe some one can spot the mistake i am posting my view and the controller. CONTROLLER Code: class Display extends CI_Controller { VIEW Code: <div class="content">
[eluser]davidMC1982[/eluser]
The view function in your controller does not set $data['table'] and $data['pagination'] hence why $table and $pagination are not available to your view.
[eluser]ede196620[/eluser]
pagination ad data is set in index function i fallowed a tutorial for this and the guy did it this way
[eluser]davidMC1982[/eluser]
The index function will only get called when your url is something like: http://www.example.com/display/ When your url is something like: http://www.example.com/display/view/234 the view function is called. Your view function doesn't set the table and pagination variables hence the error.
[eluser]ede196620[/eluser]
i am new to codeigniter and daunt know much can u give me some sample code so i would have an idea how to fix this or something ?
[eluser]davidMC1982[/eluser]
I have no idea what you're trying to achieve. It looks like your view() function is trying to display the details of a question, but you are trying to load the view that displays the list of questions. Change your view function to: Code: function view($id){ Create a new view in your views folder called display_question.php and put this code in it: Code: <?php echo print_r($query); ?> Test it works (you should have the contents of $query on the screen). Now modify the display_question view to make it a proper html page, displaying the data however makes sense to you. |
Welcome Guest, Not a member yet? Register Sign In |