Can anyone tell me what i’am doing wrong…
<?php
session_start();
include_once("conn.php");
$cat=mssql_query("Select * from tblCat");
?>
<html>
<head>
</head>
<body>
<table>
<?php
echo '<tr>';
echo '<td>Category</td>';
echo '<td>';
echo "<select name='catname' >";
echo "<option></option>";
while($catname=mssql_fetch_assoc($cat)){
echo "<option value='".$catname[CatName]."'>".$catname['CatName']."</option>";
}
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>Sub-Category</td>';
echo '<td>';
if($subcat=mssql_query("Select * from tblSubCat where CatName='$_POST[catname]'"))
echo "<Select name='catname'>";
echo "<option></option>";
while($subcatname=mssql_fetch_assoc($subcat)){
echo "<option value='".$subcatname[CatName]."'>".$subcatname['CatName']."</option>";
}
echo '</tr>';
?>
</table>
</body>
</html>