I'm getting trouble with drop down list.
I have created a form and table to display records in table.
But I'm not sure how to make use of the drop down list to search according to the particular type of the table.
What should I add in the following code in order to make the search work?
๐
Really thx for your kind attention.
<html>
<head>
<title>Shared Reference</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<STYLE TYPE="text/css">
<!--
BODY {
background-image:url('img/bkpc.gif');
background-repeat:no-repeat;
background-attachment: fixed;
background-position: 95% 95%
scrollbar-base-color : #ffffff;
scrollbar-face-color : #ffffff;
scrollbar-track-color: #ffffff;
scrollbar-arrow-color : #808080;
scrollbar-3dlight-color: #ffffff;
scrollbar-highlight-color : #ffffff;
scrollbar-shadow-color : #ffffff;
scrollbar-darkshadow-color : #ffffff;
color: #808080; font-size: 13px; cursor: none; }
TABLE { color: #808080; font-size: 13px; cursor: none;}
FORM { color: #808080; font-size: 13px; cursor: none;}
A:link { color: #808080; text-decoration: none ; }
A:visited { color: #808080; text-decoration: none; }
A:active { color: #808080; text-decoration: none; }
A:hover { color: #808080; text-decoration: underline ; cursor: none; }
-->
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="fmProjDiary" method="post" action="">
<table cellspacing=0 cellpadding=0 width="890" height="100%" border="0" bordercolor="#808080">
<tr>
<td align="left" valign="middle" height="8" width="886">
<table width="886" border="0">
<tr>
<td width="878"><font size="4" face="Arial"><b>Shared Reference</b></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="formText" width="886">
<b><font face="Arial">
Reference Type: </font></b><font face="Arial"><select name="Type" class=normal>
<option value="All">All</option>
<option value="Book">Book</option>
<option value="CD ROM">CD-ROM</option>
<option value="Website">Website</option>
<option value="Tape">Tape</option>
<option value="Other">Other</option>
</select> <input style="background-color:#CBC5AB" type="submit" value="Search" name="Go"/></font><b><font face="Arial"> </font></b>
</td>
<td width="1">
</td>
</tr>
<td width="886">
<?
//MyDB represents the name of the database.
//MyTable represents the name of the table inside the database.
mysql_connect("localhost","","") or die("Unable to connect to SQL server");
@mysql_select_db("project") or die("Unable to select database");
$result = mysql_query("select groups.gp_name, ref_materials.ref_type, ref_materials.ref_name, ref_materials.ref_author, ref_materials.ref_desc from ref_materials, groups where ref_materials.gp_id=groups.gp_id and ref_materials.ref_share='YES'");
?>
<p>ยก@
<tr>
<td align="left" valign="top" height="90%" width="886">
<table width="150%" border="0">
<tr bgcolor="#cbc5ab">
<td height="18"><b>Group</b></td>
<td height="18"><b>Reference Type</b></td>
<td height="18"><b>Reference Title</b></td>
<td height="18"><b>Author</b></td>
<td height="18"><b>Description</b></td>
<td height="18"><b>Data Field</b></td>
</tr>
<?
while ($row = mysql_fetch_row($result)) {
echo "<tr bgcolor='#f5f3e9'>";
for ($i=0; $i<mysql_num_fields($result); $i++) {
echo "<td>";
echo "$row[$i]";
echo "</td>";
}
echo "</tr>\n";
}
echo "</table>";
?>
</table>
<p>
<form method="post" action="new1.php" enctype="text/plain">
</body>