PHP 代码:
连接Mysql数据库
<?
//Create a variable to hold the result of the mysql_connect() function:
//Within the die() function, use the mysql_error() function.
$connection = mysql_connect("localhost", "root", "")
or die(mysql_error());
if ($connection) {
$msg = "success!";
}
?>
<HTML>
<HEAD>
<TITLE>MySQL Connection</TITLE>
</HEAD>
<BODY>
<? echo "$msg"; ?>
</BODY>
</HTML>