<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>無標題文件</title>
<style type="text/css">
<!--
.style2 {color: #99FF33}
.style3 {
color: #6699CC;
font-style: italic;
font-weight: bold;
}
-->
</style>
</head>
<body>
<?php
mysql_connect("localhost","","");
mysql_select_db("score");
$query="select * from score";
if($b1<>""){
$query="select * from score where math < 60";
}
if($b2<>""){
$query="select * from score order by total desc limit 0,9";
}
if($b3<>""){
$query="select * from score order by total desc";
}
if($b4<>""){
$query="select * from score where number='$n'";
}
if($b5<>""){
$query="select * from score";
}
$rows=mysql_query($query);
?>
<div align="center">
<h1 class="style3">資二乙暑假作業成績</h1>
<table width="50%" border="1">
<tr bgcolor="#336633">
<td><div align="center"><span class="style2">座號</span></div></td>
<td><div align="center"><span class="style2">姓名</span></div></td>
<td><div align="center"><span class="style2">國文</span></div></td>
<td><div align="center"><span class="style2">英文</span></div></td>
<td><div align="center"><span class="style2">數學</span></div></td>
<td><div align="center"><span class="style2">總分</span></div></td>
</tr>
<?
while($row=mysql_fetch_row($rows)){
?>
<tr>
<td><?=$row[0]?></td>
<td><?=$row[1]?></td>
<td><?=$row[2]?></td>
<td><?=$row[3]?></td>
<td><?=$row[4]?></td>
<td><?=$row[5]?></td>
</tr>
<?
}
?>
</table>
<form name="form1" method="post" action="show.php">
<p>
<input name="b1" type="submit" id="b1" value="數學不及格">
<input name="b2" type="submit" id="b2" value="前十名">
<input name="b3" type="submit" id="b3" value="按總分排名">
<input name="b5" type="submit" id="b5" value="顯示全部">
</p>
<p>座號:
<input type="text" name="n">
<input name="b4" type="submit" id="b4" value="查詢">
</p>
</form>
<p> </p>
</div>
</body>
</html>
- Oct 16 Tue 2007 14:56
龍生php私房菜
close
全站熱搜
留言列表