且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL连接失败

更新时间:2023-02-16 18:27:43

Host =" localhost";

User =" Fred";


Database =" house";


I have the following code

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

@ $db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

The first echo is executed but the second is not. I have ran the very same
parameters from the command line using:

mysql -h localhost -u Fred -p

Then

use house

and I connect to the house database.

I tried this in both IE 7 and Firefox with the same results.

I''m new to this stuff so all help will be appreciated.

Thanks..


Host = "localhost";


User = "Fred";


Database = "house";