<?php
include ("include/db-connect.php");

$q=$_GET["q"];


 $sql="SELECT * FROM  ".$SUBCAT."  WHERE id = '".$q."'";

$result = mysql_query($sql);
$row = mysql_fetch_array($result);

$cat=$row['cat_name'];

$sub_cat=$row['subcat'];

?>
<select name="sub_sub_cat" style=" width:200px;">
<?php
$sqlzdfsdf="SELECT * FROM sub_sub_category WHERE cat = '$cat' and sub_cat = '$sub_cat'";
$resultasdasd = mysql_query($sqlzdfsdf);
while($rowffff = mysql_fetch_array($resultasdasd))
{
?>	
<option value="<?php echo $rowffff['id']; ?>"><?php echo $rowffff['sub_sub_cat']; ?></option>
<?php
}
?>

</select>