php链接到mysql的简单示例
需要提供mysql的服务器地址,用户名和密码,这里mysql装在本机,所以使用localhost
<?php $UserName = 'abc'; $Password = '8sj27s'; $DbHandle = mysql_connect ('localhost', $UserName, $Password); if (!$DbHandle) { die 'No database connection could be established.'; } ?>