• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check database driver name

I am writing a library and I would like to know which database project is using
there is a small difference if it is MySQL or PostgreSQL...

Is it a field or method what will return database driver name like

$this->db->driver_name ()
what will return 'mysql' or 'postgre' according to what $this->db is driving on ?


I think $this->db->dbdriver contains the name.

// this is the start of the mysql driver file; it extends CI_DB that ends up in $this->db.

class CI_DB_mysql_driver extends CI_DB {

    var $dbdriver = 'mysql';

Thank You -

"Sometimes thing to close to you nose become invisible" Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.