Ошибка getwhere () в codeigniter? - PullRequest
       3

Ошибка getwhere () в codeigniter?

1 голос
/ 21 сентября 2011

Как мне позвонить, устранить ошибку?

Fatal error: Call to undefined method CI_DB_mysql_driver::getwhere() in C:\xampp\htdocs\ci_learn\application\models\employee_model.php on line 18



<?php 
class Employee_model extends CI_Model {
function Employee_model()
{
    parent::__construct();
}

function employee_getall()
{
    $this->load->database();
    $query = $this->db->get('employee');
    return $query->result();
}

function employee_get()
{
    $this->load->database();
    $query = $this->db->getwhere('employee', array('id' => 1));
    return $query->row_array();
}
} ?>

Ответы [ 2 ]

4 голосов
/ 21 сентября 2011

Согласно документам , getwhere() было изменено на get_where(). Оглядываясь назад на журнал CodeIgniter Git , видно, что он был удален 6 августа 2010 года, поэтому у всех выпусков после этого его нет.

2 голосов
/ 27 февраля 2015
<?php 
class Employee_model extends CI_Model {
function Employee_model()
{
    parent::__construct();
}

function employee_getall()
{
    $this->load->database();
    $query = $this->db->get('employee');
    return $query->result();
}

function employee_get()
{
    $this->load->database();
    $query = $this->db->get_where('employee', array('id' => 1));
    return $query->row_array();
}
} ?>

Оглядываясь на [CodeIgniter Gitlog] [1], похоже, что он был удален 6 августа 2010 года, поэтому у всех выпусков после этого его нет. Согласно документам , getwhere() был изменен на get_where().

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...