php
<meta http-equiv="content-type" content="text/html"; charset="utf-8" />
<title>phptest</title>
</head>
<body>
<?php
mysql_query("SET NAMES utf8");
$db_link = @mysql_connect("localhost","root","111")
or die("cannot");
mysql_query("SET NAMES 'utf8'");
$select_db = @mysql_select_db("php");
if(!$select_db)
die("X");
else
{
echo"db_connect"."<br>";
$mysql_query= "SELECT * FROM member";
$result = mysql_query($mysql_query);
echo "第五筆第三欄".mysql_result($result,4,2)."<br>";
echo "<table border='1'> <tr align='center'>";
for($i = 0;$i<mysql_num_fields($result);$i++)
{
echo "<td>".mysql_fetch_field($result,$i)->name."</td>";
}
echo"<tr>";
while($row = mysql_fetch_row($result))
{
echo"<tr>";
for($j = 0; $j<mysql_num_fields($result);$j++)
{
echo "<td>$row[$j]</td>";
}
echo"<tr/>";
}
}
@mysql_close($db_link);
?>
</body>
</html>