class CI_DB_mysqli_result could not be converted to string |
Hello,
I am trying to fix this error message but could not find a way out yet. Can anyone help me out? Thanks in advance. A PHP Error was encountered Severity: 4096 Message: Object of class CI_DB_mysqli_result could not be converted to string Filename: views/pcategories.php Line Number: 53 Backtrace: File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\EcommerceGiondaCI\application\views\pcategories.php Line: 53 Function: _error_handler File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\EcommerceGiondaCI\application\controllers\Cpages.php Line: 215 Function: view File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\EcommerceGiondaCI\index.php Line: 315 Function: require_once models/Pages_model.php PHP Code: public function call_menu() controllers/cpages.php PHP Code: public function pcategories() { views/pcategories.php PHP Code: <div class="row-fluid"> Line 53: <td><?php echo $menu; ?></td>
" If I looks more intelligence please increase my reputation."
Do you know the difference between a result() object and a result_array() array?
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Its all explained in the ci docs here
Generating Query Results http://www.codeigniter.com/user_guide/da...sults.html In PHP Code: public function call_menu() change Code: return $query->result(); Code: return $query->result_array(); This will give you an array to work with as follows from the controller PHP Code: public function pcategories() And in your view you can show the results as follows PHP Code: foreach ($menu as $array => $row)
He never learns anything he just keeps asking the same error questions over and over.
Sit down and take the time to try and learn what your trying to do. Google search is your friend. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |