query(„SELECT DATABASE()“); $row = $result->fetch_row(); printf(„Default database is %s.n“, $row[0]); /* change default database to „world“ */ $mysqli->select_db(„world“); /* get the name of the current default database */ $result = $mysqli->query(„SELECT DATABASE()“); $row = $result->fetch_row(); printf(„Default database is %s.n“, $row[0]); The above examples will output:

Default database is test. Default database is world.

By admin