Howdy there,
I am trying to find a menu type which by car looks. EX: Car 12 months, Car Make, Car or truck Model
I want to implement this to a site of mine but have no clue on how to be able to pursue this.
Thanks earlier.
The author
What do you mean Sort a database by way of certain parameter Is it possible to give us a sample, please
Such as at www. kbb. com
You will discover three drop down menus.
Calendar year:
Help make:
Design:
In the event you select Ford, it lists the Ford styles under Models, in the event you select Dodge is definitely lists Dodge designs. Those drop downs are usually disabled until you end up picking the prior just one. Make sense
I believe its database driven just unclear as to how its organized.
I hope this helps and so solve my dilemma.
Thanks for the quick reply incidentally.
Make a new database table called cars.
In the table add THREE OR MORE fields, year, help make and model.
When people make use of the form after that you can fire off a sql statement based on what the person inputed. All it is advisable to do then is list the results.
Yes, a fairly simple implementation of an database. Our help requirements more background information on you… how far do you think you’re in to your database system
Well I here’s experimenting with ASP plus Visual Web Designer and I would like to make sure i make it the proper way. Ok well you mentioned building a table called " cars" and then list year, help make, model. Now how do you implement, lets say a Ford Center. to be listed and produce a query to carry it up correctly I don’t know easily am saying that right but WHEN I donno if like you’d need to pull from this cars table and then have a separate table for the actual cars.
Listed here is a possible PHP alternative. You’ll need a database which includes a table name something similar to " cars" by using these fields: name, year, make, in addition to model. Now create a file named " advanced_search. php" and then create within this file a questionnaire:
< variety name=" advanced_search" method=" post" action=" advanced_search. php" > < enter type=" hidden" name=" field" value=" < php reveal $field; > " class=" hidden" /> < enter type=" hidden" name=" find" value=" < php reveal $find; > " class=" hidden" /> < enter type=" text" name=" find" value=" Seek... " checked=" checked" maxlength=" 35" onBlur=" if(this. value=='') this specific. value='Search... '; " onFocus=" if(this. value=='Search... ') this specific. value=''; " /> < choose name=" field" > < choice value=" year" > Year< /option> < choice value=" make" > Make< /option> < choice value=" model" > Model< /option> < enter type=" submit" class=" css_button" name=" search" value=" Search" title=" Search" /> < /form>
Now you need methods to process the variety. The following snippet could search the database table from the selected colum (the columns are classified by the drop down list) for your search term entered by the individual..
< php
//don't forget for connecting to the repository!
//define the db desk
$table = vehicles;
//if the search form continues to be submitted
if ($search)
// search term filtering
$find = strtoupper($find);
$find = strip_tags($find);
$find = toned ($find);
// db problem
$result = mysql_query(" CHOOSE * FROM $table WHEN $field LIKE '%$find%'" );
$total = mysql_result($result, 0, 0);
//get the result from the search
$result = mysql_query($query);
//show the dining room table of results if you will discover any results
in the event ($result > 0)
//table mind
echo " < kitchen table class=\" invoice-list\" > ";
reveal " < tr> ";
reveal " < td> Year< /td> ";
reveal " < td> Make< /td> ";
reveal " < td> Model< /td> ";
reveal " < /tr> ";
//create not one but two classes for alternating rows
$num_classes = A COUPLE OF;
$i = 0;
//loop in the results
while ($row = mysql_fetch_array($result))
//define variables in the db rows
$id = $row" id";
$year = $row" year";
$make = $row" make";
$model = $row" model";
//table rows
reveal " < tr class=\" row_". $i++%$num_classes. " \" > ";
reveal " < td> $year< /td> ";
reveal " < td> $make< /td> ";
reveal " < td> $model< /td> ";
reveal " < /tr> ";
reveal " < /table> ";
>
There might be typos because this is certainly just some computer code I extracted from one of my scripts and simplified to your purpose.