|
直接写 php测试文件 test.php
$dbhost = 'localhost:3306';
$dbuser = 'root';
$dbpass = '123456';
$dbname = 'mysql';
phpinfo();
$con=mysql_connect($dbhost,$dbuser,$dbpass,$dbname);
// Check connection
if (!$con)
{
echo "Failed to connect to MySQL: " . mysql_connect_error();
}
else
{
echo "finally connet mysql";
}
可以连接上db
但是在CI框架中 提示 Message: Call to undefined function mysql_connect() |
|