同样的代码,在本机上测试运行很快,但是放到了服务器上,则需要大约5-6秒左右的时间
代码如下:
$username="user";
$userpass="123";
$dbhost= "localhost";
$db_connect=mysql_connect($dbhost,$username,$userpass)
or die("Unable to connect to the MySQL!");
mysql_select_db('info');
本机环境:windows xp , XAMPP
服务器环境:windows 2008, XAMPP
将 $dblost="localhost" 改成了 $dblost="127.0.0.1";
速度提升了不少