X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdba.php;h=920027cbcfaeef721a02f2ec3214efed0fcf459b;hb=66482c1d9c35942f6b09a076d19f335d4afbfa0d;hp=082a54bd496694875cb7756974f049c2f065a179;hpb=a65479ccfd8cc3f949b16eb81e99c9af328d08d2;p=friendica.git diff --git a/include/dba.php b/include/dba.php index 082a54bd49..920027cbcf 100644 --- a/include/dba.php +++ b/include/dba.php @@ -35,7 +35,7 @@ class dba { public $error = false; function __construct($server, $user, $pass, $db, $install = false) { - global $a; + $a = get_app(); $stamp1 = microtime(true); @@ -109,6 +109,17 @@ class dba { return $return; } + /** + * @brief Returns the selected database name + * + * @return string + */ + public function database_name() { + $r = $this->q("SELECT DATABASE() AS `db`"); + + return $r[0]['db']; + } + /** * @brief Returns the number of rows * @@ -128,7 +139,7 @@ class dba { } public function q($sql, $onlyquery = false) { - global $a; + $a = get_app(); if (!$this->db || !$this->connected) { return false;