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

#1
[eluser]Unknown[/eluser]
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 ?

Bensiu

#2
[eluser]mddd[/eluser]
I think $this->db->dbdriver contains the name.

Code:
// 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';

#3
[eluser]Unknown[/eluser]
Thank You -

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

Bensiu


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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