網路教學(e-Learning)校園社群(e-Community)服務台(e-Service)系所班網(e-Class)登入
位置: 高鈺婷 > 未分類
0422-php
by 高鈺婷 2013-04-22 11:01:31, 回應(0), 人氣(616)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phptest</title>
</head>

<body>
<?php
$db_link = @mysql_connect("localhost","root","111")
or die("cannot");

$select_db = @mysql_select_db("class");
mysql_query("SET NAMES 'utf8'");

if(!$select_db)
die("X");
else
{
echo"db_connect"."<br>";
$mysql_query= "SELECT * FROM member";
$result = mysql_query($mysql_query);
echo "<table border='1'> <tr align='center'>";
while($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo"<tr>";
echo"<td>".$row["id"]."</td>";
echo"<td>".$row["name"]."</td>";
echo"<td>".$row["account"]."</td>";
echo"<td>".$row["password"]."</td>";
echo"<td>".$row["sex"]."</td>";
echo"<td>".$row["birthday"]."</td>";
}
}
@mysql_close($db_link);

?>
</body>
</html>