php链接mysql数据库并作简单的查询
<?php $UserName = 'abc'; $Password = '1234'; $DbHandle = mysql_connect ('localhost', $UserName, $Password); if (!$DbHandle) { die 'No database connection could be established.'; } $DBName = 'w3db; if (!mysql_select_db ($DBName, $DbHandle)) { die 'Database could not be selected.'; } ?>