php链接到mysql数据库,最后关闭链接的代码演示
用mysql_connect链接到数据库,用mysql_close关闭数据库
<?php $UserName = 'abc'; $Password = '8sj27s'; $DbHandle = mysql_connect ('localhost', $UserName, $Password); if (!$DbHandle) { die 'No database connection could be established.'; } mysql_close ($DbHandle); ?>