Good Afternoon Experts!
I am looking to put in a search engine to our website to filter by specific vehicles.
A bit of details about the site:
The website currently filters by vehicle type – cars, trucks, sport utilities, vans, and toys
Toys are things like motorcycles, boats, etc.
We have anywhere from 400-700 vehicles active on the website at any given time
The site uses PHP/MySQL, with the update to the site it will be the most current version of both.
The problem: There are a couple of different ways I am looking at approaching this and I’m looking for advice on which I should go and how I would go about doing it.
I need to be able to search the following fields: 1) year 2) make 3) model
In addition I plan on putting in a filter by stock number, but this one will be easy as it will only display the stock number they are looking for. The following code will easily take care of that one.
$query = “select * from vehicle_table where stocknumber = $stocknumber”
1. Option 1
I have thought about using AJAX to be able to select a make, and then display model, and then display only the available years for that make and model combination. I’m not quite certain how I would do that.
2. Option 2
The other option I have thought of is to do a select box and list all of the available makes in one box and models in another box. Followed by a box that shows start year and a box that shows end year.
Variables / Tables / Data storage
The information I am looking to search is currently in a single table.
(similar table name) – vehicle_info
Variable 1 – make
Variable 2 – model
Variable 3 – year
I am certain I am forgetting information, but if you need more let me know and I will do my best to add any information I have forgot to list above.