ycoleman Posted April 7, 2007 Share Posted April 7, 2007 The products list displays okay, but when you click on the subcategory the product lists does not match with the subcategory in the ProductList.php. Heres the code: <?php error_reporting(E_ALL); ini_set('display_errors', '1');?> <?php if (isset($_GET['SubCatID'])) { $thisCatID = (int)$_GET['SubCatID']; } else { $thisCatID = 1; } ?> <?php //product list $sql_2 ="SELECT * FROM tblProduct WHERE SubCatID = '".mysql_real_escape_string($thisCatID)."'"; $result = @mysql_query($sql_2,$db) or die(mysql_error()); while($row= mysql_fetch_array($result)){ $smallimg = $row['SmallImage']; $productname = $row['ProductName']; $unitprice = $row['UnitPrice']; $thisCatID =$row['CatID']; //$description = $row['Description']; $inventory = $row['Inventory']; $catid = $row['CatID']; $subcatid = $row['SubCatID']; //$largeimg = $row['LargeImage']; echo "<p>" . "$productname" . "</p>"; echo "<p>". "$" ."$unitprice" . "</p>"; echo "<a href='ProductList.php?SubCatID=$subcatid'>$productname</a><br>"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.