filter recordset category to sub category not working, what am i doing wrong
I have done this lots of times but must have made a mistake because i cant get it to work
i have a category list displaying all categories
ymysql_select_db($database_lotties, $lotties);
$query_rsProductData = "SELECT * FROM lottieCat ORDER BY lottieCat.CatName";
$rsProductData = mysql_query($query_rsProductData, $lotties) or die(mysql_error());
$row_rsProductData = mysql_fetch_assoc($rsProductData);
$totalRows_rsProductData = mysql_num_rows($rsProductData);
?>
<?php do { ?>
<a href="subCat-list.php?subCat=<?php echo $row_rsProductData['subCatID']; ?>"><?php echo $row_rsProductData['CatName']; ?><br />
</a>
<?php } while ($row_rsProductData = mysql_fetch_assoc($rsProductData)); ?>
<?php
mysql_free_result($rsProductData);
?>
but on the link i want to send the to the sub category page but it isnt working. below is the sql for the sub category page
$varCat_rsProductData = "0";
if (isset($_GET["subCat"])) {
$varCat_rsProductData = $_GET["subCat"];
}
mysql_select_db($database_lotties, $lotties);
$query_rsProductData = sprintf("SELECT * FROM LOTTIE_subCats, lottieCat WHERE lottieCat.CatID = LOTTIE_subCats.CatID AND lottieCat.CatID = %s", GetSQLValueString($varCat_rsProductData, "int"));
$query_limit_rsProductData = sprintf("%s LIMIT %d, %d", $query_rsProductData, $startRow_rsProductData, $maxRows_rsProductData);
$rsProductData = mysql_query($query_limit_rsProductData, $lotties) or die(mysql_error());
$row_rsProductData = mysql_fetch_assoc($rsProductData);
the joins in the table are
table = lottieCat
CatID
Catname
table=LOTTIE_subCats
subCatID
CatID
then the products is
table = LOTTIE_products
subCatID
what am i doing wrong
