Jump to content

Archived

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

tet3828

file description, thumbnail and full size image

Recommended Posts

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

Share this post


Link to post
Share on other sites
[code=php:0]<?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>";
}
?>[/code]

A very insecure and simple example.

Share this post


Link to post
Share on other sites

×

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.