Welcome Guest, Not a member yet? Register   Sign In
Array To String error / undefined $query

I'm learning CodeIgniter 3 and have come to a halt because of a (probably) stupid thing I did. Could you help me in identifying the issue in my code?
I'm trying to display some rows of data from a database and I get this error
Quote:A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: core/MY_Controller.php Line Number: 24 Backtrace:
File: /public_html/siiga/application/core/MY_Controller.php Line: 24 Function: _error_handler
File: /public_html/siiga/application/core/MY_Controller.php Line: 45 Function: render
File: /public_html/siiga/application/controllers/admin/Docs.php Line: 74 Function: render
File: /public_html/siiga/index.php Line: 315 Function: require_once
My Controller
 public function existing() // Recieved, Unsolved
     $data['query'] = $this->Docs_model->viewexisting();
     $this->render('admin/docs/existing_view', $data);
My Model
public function viewexisting()
   $query = $this->db->query("SELECT * FROM docs");
   return $query->result();  
My View
<?php foreach($query as $row){?>
       <td><?php echo $row->numar_inreg ;?></td>
       <td><?php echo $row->nume_doc ;?></td>

<?php }?>

Help? Please?

Messages In This Thread
Array To String error / undefined $query - by CodinMoldovanu - 08-14-2016, 06:58 AM

Theme © iAndrew 2016 - Forum software by © MyBB