Undefined property |
I think the program is correct, but it appears that it is an error. Please someone help me.
A PHP Error was encountered Severity: Notice Message: Undefined property: mysqli::$ProductID Filename: controllers/ProductsUI.php CI_Model: PHP Code: function get_product(){ CI_Controller: PHP Code: $str = '';
The problem is this line doesn't return what you think it does
PHP Code: return $this->db->get('product'); You need to Generate Query Results from the returned value - they cannot be read directly. You need something along these lines PHP Code: $this->load->model('Product'); Or, you could have the model return an actual result set PHP Code: function get_product() Then your controller code would work as shown in your original post.
Thank for dave friend.
i use this code. PHP Code: $rows = $this->Product->get_product()->result(); A PHP Error was encountered Severity: Warning Message: A non-numeric value encountered Filename: controllers/ProductsUI.php Line Number: 32 Backtrace: File: C:\xampp\htdocs\accounting\application\controllers\ProductsUI.php Line: 32 Function: _error_handler PHP Code: <td>'.$row->Cost.'</td>
I had not looked closely at the code in the loop. Here's my opinion on how it should be written
PHP Code: foreach($this->Product->get_product() as $row)
|
Welcome Guest, Not a member yet? Register Sign In |