Error Array to string conversion - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Error Array to string conversion (/showthread.php?tid=71510) |
Error Array to string conversion - toshihikoyuta - 08-21-2018 Hello! Im gonna filtering recored from mysql database using dropdown. and when i run the code, i got some error like this : A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: models/NewTim_Model.php Line Number: 13 and this is my model : Code: <?php my controller : PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); my view Code: <?php $this->load->view('templates/header_manajer');?> and my table on the attachment please tell me what sholud i do with this code, thank you RE: Error Array to string conversion - jreklund - 08-22-2018 You are passing in an array. But it expects a single value (string). Controller: PHP Code: $records = $this->NewTim_Model->getRecords($getTim); Model: PHP Code: public function getRecords($timid){ Also, you should not write your SQL like that. You can be a subject of SQL injections. https://www.codeigniter.com/user_guide/database/queries.html#query-bindings |