<?php phpinfo();
$db_connection = mysql_connect("localhost","root","110");
mysql_select_db("szcpost",$db_connection) or die("Cannot open database test");
// 读取当前数据库名
www.szcpost.comfunction mysql_current_db()
{
$r = mysql_query("SELECT DATABASE()") or die(mysql_error());
return mysql_result($r,0);
}
function get_host_info()
{
return mysql_get_host_info();
}
function get_client_info()
{
return mysql_get_client_info();
}
$db_name = mysql_current_db();
echo $db_name;
?>