Jump to content

[SOLVED] Need Help with creating a Product list page!!!!


ycoleman

Recommended Posts

On my product page, I was able to retrieve information from the database but I get an error message that says "Notice: Undefined variable: SubCatID "  and I can`t get my list to display right.  I wanted my SmallIMG to be on the right and my and my ProductName to appear right beside it along with the UnitPrice.  Kinda like straight across because I want it to be a link to the individual product page. If I can get help on this part, I can get started on my shopping cart. 

 

Here is my 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"; 

$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`]; 

//$description = $row[`Description`]; 

 

//$inventory = $row[`Inventory`]; 

$catid = $row[`CatID`]; 

$subcatid = $row[`SubCatID`]; 

 

//$largeimg = $row[`LargeImage`]; 

 

echo "<p>" . "$productname" . "</p>"; echo "$" ."$unitprice"; 

echo "<a href=`ProductList.php?SubCatID=1" . $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.