Skip to content

Commit

Permalink
Added method for getting the currently selected db
Browse files Browse the repository at this point in the history
...thanks to Stijn for suggesting
  • Loading branch information
stefangabos committed Dec 28, 2014
1 parent 946d708 commit e6fea5a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Zebra_Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,23 @@ function get_link()

}

/**
* Returns the name of the currently selected database.
*
* @since 2.8.7
*
* @return mixed Returns the name of the currently selected database, or FALSE if there's no active connection.
*/
public function get_selected_database() {

// if an active connection exists
if ($this->_connected()) return $this->credentials['database'];

// return false if there's no connection
return false;

}

/**
* Returns information about the columns of a given table, as an associative array.
*
Expand Down

0 comments on commit e6fea5a

Please sign in to comment.