hello, i am displaying a \"product list\" for a site i am working on and I have a question about distinct.
this is my current query to mysql
// mysql query
$query = \"select distinct name, brand, wheelsize, finish, price, packageprice, comments, picture, thumbnail from wheels where brand = \'$brand\';\";
First question, is that the correct usage of distinct... (obviously i don\'t need the whole data to be distinct but i need all of those fields from the db to display to the enduser)
Second question,
Say i have a product brand of
X1000
and inside the database i have two or more different \"names\" like
spiffy
awesome
While the spiffy and awesome can have multiple wheel sizes / finishes i want the information grouped together in a certain way such as this
START OF HTML TABLE
X1000 - spiffy
all the combos that exist of size / finish for the x1000 - spiffy
END OF HTML TABLE
START OF HTML TABLE
X1000 - awesome
all the combos that exist of size / finish for the x1000 - awesome
END OF HTML TABLE
it boils down to this, with that current select syntax it selects ALL the X1000\'s and they all get glued together. such that the awesome\'s and spiffy\'s are in the same html table together.
do i need to nest some select querys and query the database more than once?
if you guys need more code pasted from me i can do so.