From 33223b5b6c10d24c1c7aa09939b7e4a064fa9e5e Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 4 Jan 2008 23:37:25 +0000 Subject: [PATCH] getDatabaseName() --- lib/Doctrine/Connection/Mysql.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Doctrine/Connection/Mysql.php b/lib/Doctrine/Connection/Mysql.php index 32cd5aa50..67fc092bf 100644 --- a/lib/Doctrine/Connection/Mysql.php +++ b/lib/Doctrine/Connection/Mysql.php @@ -90,6 +90,16 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common parent::__construct($manager, $adapter); } + /** + * returns the name of the connected database + * + * @return string + */ + public function getDatabaseName() + { + return $this->fetchOne('SELECT DATABASE()'); + } + /** * Set the charset on the current connection *