filtering multiple recordset.
I have posted 2 more discussions on the forum so i do aplogise but i am unsure the best way to describe what i am looking for
i have a product page. with links to individual products
<a href="product-description.php?ID=<?php echo $row_Recordset1['ID']; ?>"><img src="../images/AW/thumbs/<?php echo $row_Recordset1['imageSmall']; ?>"/></a>
on the product page i need to call in other tables based on the catagory of the product and sizes of the product,
i have created multiple recordsets joining the table but need help with the filtering of the information
i have a recordset showing the product information (basics - name, size, price)
$colname_Recordset1 = "-1";
if (isset($_GET['ID'])) {
$colname_Recordset1 = $_GET['ID'];
}
mysql_select_db($database_beau, $beau);
$query_Recordset1 = sprintf("SELECT * FROM beauProd WHERE ID = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $beau) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
i have a recordset to join the size table with the product table
$colname_Recordset2 = "-1";
if (isset($_GET['SizeProdID'])) {
$colname_Recordset2 = $_GET['SizeProdID'];
}
mysql_select_db($database_beau, $beau);
$query_Recordset2 = sprintf("SELECT * FROM beauProd, beauSizes WHERE beauSizes.SizeProdID = beauProd.SizeProdID AND beauProd.SizeProdID = %s", GetSQLValueString($colname_Recordset2, "int"));
$Recordset2 = mysql_query($query_Recordset2, $beau) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
in the body i have a select list that needs to display the records of all the products in that catagory
<form id="FormName" action="" method="get" name="FormName">
<table width="300">
<tr>
<td><select name="name" class="text" id="selectName">
<option value="Select Design">Select Design</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['ID']; ?>"><?php echo $row_Recordset1['name']; ?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select></td>
<td><div align="right">
<input type="submit" name="button" id="button" value="select" />
</div></td>
</tr>
</table>
</form>
and a select list that needs to show the sizes of each product
<select name="os0" class="text" id="Cos0">
<option value="select Category">Select Size</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset2['SizeProdID']; ?>"><?php echo $row_Recordset2['from'] . " - " . $row_Recordset2['to'] ; ?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</select>
the way i have it at the moment i cant get either select list to work. CAN ANYONE ADIVSE PLEASE
thanks in advance
