请帮忙。我似乎无法让所有文件同时出现。我认为这是因为我的代码中的年份选项。就像年份选项必须至少选择一年才能起作用。我需要知道如何创建一个默认选项来显示所有年份的结果。例如 2007 - 2013 年的结果。
Search.php 代码
<?php
$rpdsad=$_POST['rpdsad'];
$type=$_POST['project'];
$year=$_POST['year'];
$section=$_POST['section'];
$adviser=$_POST['adviser'];
mysql_connect('localhost','root','');
mysql_select_db('saddb');
if($rpdsad=="sad"){
/*1 query search*/
if (empty($year) && empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE type='$type'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($year) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($year) && empty($section)){
$query=mysql_query("SELECT * from sadt WHERE adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><tr class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($year)){
$query=mysql_query("SELECT * from sadt WHERE section='$section' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($section)){
$query=mysql_query("SELECT * from sadt WHERE year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE year='$year' and section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($year) && empty($section)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($year) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($type)){
$query=mysql_query("SELECT * from sadt WHERE section='$section' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($section)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($year)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and section='$section' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($adviser)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and section='$section' and year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*4 query search*/
elseif(!empty($adviser) && !empty($type) && !empty($section) && !empty($year)){
$query=mysql_query("SELECT * from sadt WHERE type='$type' and section='$section' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>SAD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['sadcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
}
/*rpd*/
elseif ($rpdsad=="rpd"){
/*1 query search*/
if (empty($year) && empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($year) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*1 query search*/
elseif(empty($type) && empty($year) && empty($section)){
$query=mysql_query("SELECT * from rpdt WHERE adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><tr class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($year)){
$query=mysql_query("SELECT * from rpdt WHERE section='$section' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($section)){
$query=mysql_query("SELECT * from rpdt WHERE year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($type) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE year='$year' and section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($year) && empty($section)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($year) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and section='$section'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*2 query search*/
elseif(empty($section) && empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($type)){
$query=mysql_query("SELECT * from rpdt WHERE section='$section' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($section)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($year)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and section='$section' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*3 query search*/
elseif(empty($adviser)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and section='$section' and year='$year'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
/*4 query search*/
elseif(!empty($adviser) && !empty($type) && !empty($section) && !empty($year)){
$query=mysql_query("SELECT * from rpdt WHERE type='$type' and section='$section' and year='$year' and adviser='$adviser'");
echo "<div align=center><table cellspacing=0 cellpadding=4 class=\"tabs\"><TR class=\"sabt\"><td>RPD Code</td><td>Year</td><td>Section</td><td>Title</td><td>Type of OLS</td><td>Adviser</td><td>Group Leader</td></tr>";
while($row=mysql_fetch_array($query)){
echo "<tr class=\"sbat\" valign=top><td nowrap>".$row['rpdcode']."</td><td>".$row['year']."</td><td>".$row['section']."</td><td style=\"text-align: left\">".$row['title']."</td><td>".$row['type']."</td><td>".$row['adviser']."</td><td>".$row['groups']."</td><td>";
}
echo "</table></div><BR>";
}
/*end of section*/
}
?>
太感谢了!