The problem is getting the drop down menu to display each product from the group code chosen from the drop down menu. This is my code so far for this function:
if(isset($GET['SageGroup'])) {
$sgroup = $GET['SageGroup'];
} else {
$sgroup=100;
}
This is the query:
mysql_select_db($database_WebPriceUpdates, $WebPriceUpdates);
$query_Products = "SELECT * FROM Products WHERE SageGroup='$sgroup' ORDER BY Code ASC";
$query_limit_Products = sprintf("%s LIMIT %d, %d", $query_Products, $startRow_Products, $maxRows_Products);
$Products = mysql_query($query_limit_Products, $WebPriceUpdates) or die(mysql_error());
$row_Products = mysql_fetch_assoc($Products);
This is the form for the drop down menu:
<form id="form2" name="SageGroup" method="get" action="" >
<select name="SageGroup" style="width:200px" >
<option value="" <?php echo "SELECTED"; ?>>Select specific group</option>
<?php do { ?>
<option value="<?php echo $row_Sage_Groups['SageGroup']; ?>">
<?php echo $row_Sage_Groups['SageGroup']; ?>
</option>
<?php } while ($row_Sage_Groups = mysql_fetch_assoc($Sage_Groups)); ?>
</select>
</form>
So far this code shows each group code int the drop down menu but does not filter the products from the database int the able into products based on the group code selected, which is what I would like to achieve, it goes to the default group code products which is 100 ( else { $sgroup=100; }) I am not sure what needs to be added to fix this problem.