代码如下 | 复制代码 |
$Host="localhost"; $MySQL_UserName="root"; $MySQL_UserPass="password"; $MySQL_Database="db"; $Query="SELECT * FROM domain"; if (!mysql_connect ($Host, $MySQL_UserName, $MySQL_UserPass)){ print "Cannot connect to MySQL: ".mysql_error(); exit; } if (!mysql_select_db ($MySQL_Database)){ print "Cannot select db exit; } if (!$Result_ID=mysql_query ($Query)){ print "Query Error: ".mysql_error(); exit; } while ($Result=mysql_fetch_row($Result_ID)){ print "------------------ print "$Result[0] print "$Result[1] print "$Result[2] print "$Result[3] print "------------------- }?> |