Jump to content


Photo

file description, thumbnail and full size image


  • Please log in to reply
1 reply to this topic

#1 tet3828

tet3828
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts
  • Locationfort myers, FL

Posted 24 October 2006 - 01:02 PM

I must not have posed this question properly last post....22 reads to 1 response ::). Allow me to simplify...

I have a database. Each Item in the database will have  the following values:
CATAGORY
SUB-CATAGORY
STORE ITEM NUMBER
NAME
DESCRIPTION
PRICW
PRICE SMALL PICTURE
PICTURE

what script should I start with if I need all items in a selected catagory to be displayed in a table including an itme Name, Thumbnail, and price?

Thanks again! ;D


[ Enter Your Signature Here ]
Always take caution when using other peoples work.

#2 Shad

Shad
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 24 October 2006 - 02:27 PM

<?php
if ($_GET['category']) { //this would be retrieved from e.g. index.php?category=something
$category = $_GET['category'];
//Lets say your table name is "products"
$select = mysql_query("SELECT * FROM `products` WHERE `category`= '$category' ORDER BY `store_item_number` DESC");

echo "<TABLE>";
while ($qry = mysql_fetch_array($select)) {
echo "
<TR>
<TD>$qry[name]</TD><TD><IMG BORDER=\"0\" SRC=\"$qry[price_small_picture]\"></TD><TD>$qry[price]</TD>
</TR>
";
}
echo "</TABLE>";
}
?>

A very insecure and simple example.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users