database
Descriptionβ
Returns the name of the current database. If no database is selected, an empty value is returned.
Syntaxβ
database()
Parametersβ
This function does not require parameters.
Return valueβ
Returns the name of the current database as a string.
Examplesβ
-- Select a destination database.
use db_test
-- Query the name of the current database.
select database();
+------------+
| DATABASE() |
+------------+
| db_test |
+------------+
See alsoβ
USE: Switches to a destination database.