Question : Show unique thumbnail list results

I have a setup a cms system using PHP and MySQL.

The user adds products some of which have different sizes which in turn have different prices

If you check out the attached image you'll see that each product size is on a separate column. ie

product1 - size1 - price1
product1 - size2 - price2
product2 - size1 - price1
product3 - size1 - price1
product3 - size2 - price2

The attachment will explain this better.

The problem is that when i list these by id here on the thumbnail page:

http://www.leylasbijoux.com/necklaces.php

all of the variants show so if a product has three sizes three thumbnails show. What i would like to do is show one thumbnail then on the following detail page give the option to select the sizes.
Attachments:
 
database
database
 

Answer : Show unique thumbnail list results

Hi BrighteyesDesign,

Here are the code changes to group by code.

Let me know if that works for you :)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
mysql_select_db($database_Leyla, $Leyla);

$query_rs_items = " SELECT max(name) as name, max(image) as image, max(price) as price, code, max(id) as id FROM products 
					WHERE type = 'Necklaces' AND $colour_query AND price BETWEEN $range[0] AND $range[1] 
					Group by code
					ORDER BY price ASC";

$rs_items = mysql_query($query_rs_items, $Leyla) or die(mysql_error());
$row_rs_items = mysql_fetch_assoc($rs_items);
$totalRows_rs_items = mysql_num_rows($rs_items);
Random Solutions  
 
programming4us programming4us