Jump to content

Can somebody help me w/ my Product List page!!!!


ycoleman

Recommended Posts

:-[ 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>";

 

}

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.