I am making a website for a car database. I made a table called Cars with fields Name,Make,Model,Color,Doors. I have also made a search function:

SELECT * FROM Cars WHERE Name LIKE '%$search%'

This is a general search that will search the whole table, but what if I wanted a filter on it like a scroll down list for car colors or a check box for 4 door that will give me a search result. e.g I am looking for a car named Civic but I only want it to be black and 2 door.

And one extra added thing how do I then take the output, make it into a unique link for each different car and send it to a different site.

Help appreciated,

4 Years
Discussion Span
Last Post by macebooks

You could create a query such as
SELECT * FROM Cars WHERE Color = $color AND Door = $door

This query will only display result of query where the color is the same as the one in the database and also where the field Door is equal to 2 or any number requested by the user

Further more you might create in your filter Html select option item that populate number that best describe number of doors a car should have thanks.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.