I have a problem which 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:
>Select specific group <?php do { ?> <?php echo $row_Sage_Groups['SageGroup']; ?> <?php } while ($row_Sage_Groups = mysql_fetch_assoc($Sage_Groups)); ?>So far this code shows each group code but does not filter the products from the database into products based on the group code selected, which is what I would like to achieve. I believe I am missing some functions for this to work but I am not sure what as I am relatively new to php.