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
My Model
My View
Help? Please?
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:My Controller
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
Code:
public function existing() // Recieved, Unsolved
{
$this->load->database();
$this->load->model('Docs_model');
$this->load->library('table');
$data['query'] = $this->Docs_model->viewexisting();
$this->render('admin/docs/existing_view', $data);
}Code:
public function viewexisting()
{
$query = $this->db->query("SELECT * FROM docs");
return $query->result();
}Code:
<?php foreach($query as $row){?>
<table>
<tr>
<td><?php echo $row->numar_inreg ;?></td>
<td><?php echo $row->nume_doc ;?></td>
<?php }?>Help? Please?