i assume the piece of code u gave to be in index.php. with effect it means that when the option is selected...the querystring comes to this file itself. now the queries used to populate the select can still be executed if u just change the values of variables...
note the change in querystring passed from option
$sql_select = mysql_query( 'SELECT * FROM '.$prefix.'store_category where cat_id='$cat_id' order by $cat_order');
while ($row = mysql_fetch_array($sql_select))
{
echo "<table border='0' cellspacing='2' width='95%' cellpadding='10' align='center'><tr><td align='center'>";
$sql_select = mysql_query( 'SELECT * FROM '.$prefix.'store_category where cat_father_id = $cat_id order by $cat_order');
echo "<form name='form1'><select name='catergorylist' onChange='go(this)'>";
echo "<option selected >Please Select:</option>";
$more_cat = MYSQL_NUM_ROWS($sql_select);
while ($row = mysql_fetch_array($sql_select))
{
$cat_id_list = $row['cat_id'];
$category = $row['category'];
echo"<option value='index.php?cat_id=" . $cat_id . "&sub_cat=" .$cat_id_list ."'>" .$category ."</option>";
}
echo"</select></form>";
}
echo"</td></tr></table>";
using $cat_id u can execute the above query and populate the select. using sub_cat($cat_id_list) u can display the details for selected sub category.
the following shud not display the select if sub category selection has been made.
echo "<form name='form1'>";
if (isset($_REQUEST['sub_cat'])
{
echo "<select name='catergorylist' onChange='go(this)'>";
echo "<option selected >Please Select:</option>";
$more_cat = MYSQL_NUM_ROWS($sql_select);
while ($row = mysql_fetch_array($sql_select))
{
$cat_id_list = $row['cat_id'];
$category = $row['category'];
echo"<option value='index.php?cat_id=" . $cat_id . "&sub_cat=" .$cat_id_list ."'>" .$category ."</option>";
}
echo"</select>";
}
echo "</form>";
hope this helps u.... i am for my part pretty confused already! 😕