ycoleman Posted April 3, 2007 Share Posted April 3, 2007 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>"; } ?> ??? Link to comment https://forums.phpfreaks.com/topic/45356-solved-need-help-with-creating-a-product-list-page/ Share on other sites More sharing options...
trq Posted April 3, 2007 Share Posted April 3, 2007 echo "<a href='ProductList.php?SubCatID=$subcatid'>$productname</a>"; Link to comment https://forums.phpfreaks.com/topic/45356-solved-need-help-with-creating-a-product-list-page/#findComment-220258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.