저는 CI가 처음인데 mysql의 일부 데이터를 업데이트하려고합니다. 그래서 여기 내 컨트롤러Codeigniter 컨트롤러 모델 호출이 실패했습니다.
class Ci_update extends CI_Controller
{
function __construct() {
parent::__construct();
}
function index()
{
$data = array
(
'title' => 'Data Structure using C',
'text' => 'Data Structure Using C, for, IIIrd Sem VTU CSE students'
);
$id = 4 ;
$this->load->model('ci_update_model');
$this->ci_update_model($data,$id);
}
}
하고 내 모델은 다음과 같습니다
class Ci_update_model extends CI_Model
{
function __construct() {
parent::__construct();
}
function updateData($data,$id)
{
$this->db->where('id',$id);
$this->db->update('data',$data);
}
}
하지만이 프로그램을 실행하려고 할 때, 그것은 wrom 내가 뭘 Call to undefined method Ci_update::ci_update_model() in C:\wamp\www\ci\application\controllers\ci_update.php on line 19
말한다? 컨트롤러의 constructer에서
요 $ this-> ci_update_model-> function ($ var) ... $ this-> ci_update_model ($ var) ...이 경우 함수 ci_update_model을 검색하고 있습니다. 컨트롤러 클래스 내부에서 .. – Svetoslav