One day, an error suddenly occurred in the production environment. The exception thrown was probably that a certain table did not exist. I thought at the time, how could it not exist? Could it be that it was attacked by hackers? So I just want to know which database is currently used
$current_database = mysql_query("SELECT DATABASE()") or die(mysql_error());
echomysql_result($current_database,0);
The above introduces how to use code to know which database is currently being used? , including relevant content, I hope it will be helpful to friends who are interested in PHP tutorials.