網路教學(e-Learning)校園社群(e-Community)服務台(e-Service)系所班網(e-Class)登入
位置: 高鈺婷 > 未分類
php
by 高鈺婷 2013-04-01 11:01:22, 回應(0), 人氣(568)
<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>