Hi,

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,
Thanks.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.