Advice required on best way to present PHP MySQL records for user to select
Posted on 2006-03-22
I have a PHP website created in Dream-weaver. The site uses a MySQL database to record data entered by the site administrator. The site shows cars in stock by date acquired. The user can choose to select a list of car manufacturers taken from the stock table. I am using a Select Distinct query to do this and all is fine, however. Now that the list of stock manufacturers is getting quite long and is populating a table that is displayed to the user, it doesn't look quite right. The displayed manufacturers are a link to another form that displays all stock cars of that manufacturer. It all works fine but just doesn't look right. I was thinking of ways to make the Manufacturers list a bit more presentable and have the following ideas, but I have no idea how to get them to work:-
Idea One: Is there a way to display the manufacturer’s record in a table that returns the manufacturers list in columns and rows? I was thinking is there a way to may say 10 records populate column 1 then the next 10 populate column 2 and so on (the maximum number of records that can be returned by the Select Distinct query is 49, but we do not envisage this ever being the case)? I have tried to get Dream-weaver to use different queries an return certain records but is all falls apart.
Idea Two: Use a form with a dropdown list. The dropdown could be dynamically populated from the Select distinct manufacturers but then I need it to get the records from the database for all cars matching that manufacturer. I have messed around with this and seem to get stuck with only being able to retrieve the first manufacturer on the list regardless of which one was selected in the drop down!
Any suggestions on how to do this or advice on a different way of presenting the manufacturers list will be greatly appreciated.