在php中找到我连接的数据库的名称[复制]

This question already has an answer here:

Is there a way to find out the name of the database I am connected to?

I have several includes to I don't know what is the db selected

</div>

You can run a query to see which database you are connected to.

SELECT database() AS db;

See database().