I have a drop down box (combo box or list box?) that has a list of Categories. I want to select a category and it filters the list of data below by that category.
How do I add the filter?
This is my current code:
$result = mysql_query("SELECT * FROM products ORDER BY CategoryID, Product, SubProduct");
while ($row = mysql_fetch_assoc($result)) {
//echo "<tr>";
echo "<tr class=\"".$row['CategoryID']."\">";
echo "<td>";
echo "<a href='edit.php?id=".$row['ProductID']."'>edit</a> | <a href='delete.php?id=".$row['ProductID']."'>delete</a>";
echo "</td>";
echo "<td>";
echo $row['ProductID'];
echo "</td>";
echo "<td>";
echo $row['CategoryID'];
echo "</td>";
echo "<td>";
echo $row['Product'];
echo "</td>";
<snip>
echo "</tr>";
}
mysql_close();