I cannot use result() or result_array() on a variable that has been passed to the vie |
Say I have this code.
debate.php Code: <?php And inside the _comments.php view there's Code: <?php What happens is that the content from the database shows in the debate.php file, but not in the _comments.php file, when it should as I'm dealing with the same variable. What is going on?
Do
$this->load->view('_comments', array('datax' => $datax)); and in view var_dump($datax); will work. read the documentation
If that is the code your are using, then you are overwriting the $approval variable.
PHP Code: $approval= $this->db->get('posts'); Change it to this and it should work PHP Code: $query = $this->db->get('posts'); // Renamed $approval to $query
Should it in the view not be:
<?php foreach ($traffic as $approval) { echo $approval->content; } ?> the ->result() is for a database object not an array
On the package it said needs Windows 7 or better. So I installed Linux.
|
Welcome Guest, Not a member yet? Register Sign In |