Hi I have the following php form the second selection item has to relate to the first selection item but i am totally lost here here is the code i have at the moment it is displaying items in the second selection but they are not related to the first item selected.
Code:
<td class="right">
<?
$sql = "SELECT * FROM tblcatdetails ORDER BY category ASC";
$result = mysql_query($sql);
echo '<select name="category">';
while ($row = mysql_fetch_assoc($result)) {
$catid = $row["intCatID"];
$category = $row["category"];
echo '<option value="'.$catid.'">'.$category.'</option>';
}
echo '</select>';
?>
</td></tr>
<tr><td class="left">Sub Category:</td>
<td class="right">
<?
$sql = "SELECT * FROM tblsubcatdetails where intCatID='$catid' ORDER BY subcategory ASC";
$result = mysql_query($sql);
echo '<select name="subcategory">';
while ($row = mysql_fetch_assoc($result)) {
$subcatid = $row["intSubCatID"];
$subcategory = $row["subcategory"];
echo '<option value="'.$subcatid.'">'.$subcategory.'</option>';
}
echo '</select>';
?>
</td></tr>