CodeIgniter Forums
Problem Extending Database Driver - 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: Problem Extending Database Driver (/showthread.php?tid=77921)



Problem Extending Database Driver - random_msg - 11-04-2020

Hi,

Just followed the wiki (https://github.com/bcit-ci/CodeIgniter/wiki/Extending-Database-Drivers) and im getting this error:

Quote:Fatal error: Uncaught Error: Call to undefined method MY_DB_mysqli_driver::where() in /system/libraries/Session.php on line 218
Error: Call to undefined method MY_DB_mysqli_driver::where() in /system/libraries/Session.php on line 218


On line 218 of /system/libraries/Session.php:

PHP Code:
$this->CI->db->where('session_id'$session['session_id']); 

My extended class is just the example from the wiki:

PHP Code:
<?php
class MY_DB_mysqli_driver extends CI_DB_mysqli_driver
{
    public function __construct($params)
    {
        parent::__construct($params);
        log_message('debug''Extended DB driver class instantiated!');
    }

    public function get_first($table)
    {
        return $this->limit(1)->get($table);
    }



Can anyone help? 

Im using CI 2.x

Thanks


RE: Problem Extending Database Driver - random_msg - 11-10-2020

Hi Guys

Sorry to bump this, but anyone can help me here?

I can't really get my head around this.

Thanks


RE: Problem Extending Database Driver - schertt - 11-12-2020

The 2.x trunk hasn't been touched in over 5 years at this point, you may not find a lot of people here that still use it (or ever used it for that matter). You might have better luck asking on a site with a larger audience, something like SO for example.


RE: Problem Extending Database Driver - InsiteFX - 11-12-2020

You can not do it with 2x that link is for doing it to CodeIgniter 3.