CodeIgniter Forums
model function error in codeigniter 2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: model function error in codeigniter 2 (/thread-33527.html)



model function error in codeigniter 2 - El Forum - 08-30-2010

[eluser]dhaulagiri[/eluser]
Hi friends, i am building new application in codeigniter 2

I am getting error
Quote:Fatal error: Call to undefined method CI_DB_mysql_driver::getwhere() in C:\wamp\www\xxx\application\models\page_model.php on line 23

while writing this function in model
Code:
function fetchPage(){
        $data = array();
        $options = array('status'=>'yes', 'type'=>'about');
        //get items from database
        $this->db->getwhere('pages', $options, 1);
        if($q->numrows() > 0){
            $data = $q->row_array();
        }
        return $data;
        $q->free_result();
    }
pls help


model function error in codeigniter 2 - El Forum - 08-30-2010

[eluser]WanWizard[/eluser]
Have you checked the manual?

The 1.7.2. manual states:
Quote:Note: get_where() was formerly known as getwhere(), which has been deprecated

As of version 2, getwhere() (and other deprecated methods) have been removed.