Copy link to clipboard
Copied
this is a carry on from another thread.
i have catagories, products and each product has its sizes.
i have made the mysql DB with the following catagory
| int(11) | No | auto_increment | ||||||||||||
| varchar(200) | latin1_swedish_ci | No |
a products table
and a sizes table
theses are all working great in the backend
in the front end i have a product page that is displaying the product small image
<a href="product-description.php?ID=<?php echo $row_Recordset1['ID']; ?>"><img src="../images/AW/thumbs/<?php echo $row_Recordset1['imageSmall']; ?>"/></a>
and this has a repeat region to diplay all the product
in the product-description is where i am lost
i have to show
the catagory name and price that fine from recordset1
$colname_Recordset1 = "-1";
if (isset($_GET['ID'])) {
$colname_Recordset1 = $_GET['ID'];
}
mysql_select_db($database_beau, $beau);
$query_Recordset1 = sprintf("SELECT * FROM beauProd, beauCat WHERE ID = %s AND beauProd.CatID = beauCat.catID", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $beau) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
<?php echo $row_Recordset1['catname']; ?>
<?php echo $row_Recordset1['price']; ?>
I NEED a select list showing all the products from that catagory and when another product is selected and submitted it goes to that new product I have done the following select list
<form id="FormName" action="" method="get" name="FormName">
<select id="selectName" name="name">
<option value="Select Design">Select Design</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['catID']; ?>"><?php echo $row_Recordset1['catname']; ?></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>
<input type="submit" name="button" id="button" value="select" />
</form>
then i need the sizes from each product to be displayed. It currently is showing all product sizes.
i have made a new recordset2
mysql_select_db($database_beau, $beau);
$query_Recordset2 = "SELECT * FROM beauProd, beauSizes WHERE beauProd.SizeProdID = beauSizes.SizeProdID";
$Recordset2 = mysql_query($query_Recordset2, $beau) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
<select id="Cos0" name="os0">
<option value="select Category">Select Size</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset2['SizeID']; ?>"><?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>
I am tottally lost now. can anyone help
Copy link to clipboard
Copied
i think its about the filtering of the information i have tried
$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 beauSizes.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);
i need to display just the information from each product and show the "to" and "from" in the select list on the sizes
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more