write2keith Posted June 13, 2013 Share Posted June 13, 2013 Hi there I am trying to create a search form to retrive rates form multiple selections and then display the results. i have created the database in mysql database name: Rates in that there are the following 6 tables:- 1.Country 2.Area 3.Region 4.destination 5.airline 6.rate_table 1)The country has the following columns:- Country_code,Country_name,Area and Region 2)The Area table has the following columns:- Area_code,Area name and Country 3)The Region table has the following coulumns:- Region_Code,Region_Name and Country 4)The destination has the following columns:- Dest_Code,Dest_Name and Dest_Country 5. The Airline Table has the following columns:- Airline_Code and Airline_Name 6) The Rates Table has the following columns:- Rate_ID,Rate_Airline,Rate_Destination and Rate I managed to create my first drop down using the code below:- <?php//create connection$connectmysql=mysql_connect("localhost","root","root");if (!$connectmysql) {die('Not Connected :' . mysql_error());}$db_selected=mysql_select_db('rates',$connectmysql);?><?php$result = mysql_query("SELECT Country_Name FROM Country ORDER BY Country_Name") or die(mysql_error());while ($row=mysql_fetch_array($result)) {$Country_Name=$row["Country_Name"];$options.='<option value="'.$row['Country_Name'].'">'.$row['Country_Name'].'</option>';};?><html><body><SELECT NAME=catid><OPTION VALUE=0>choose</option><?php echo $options;?></SELECT></HTML> the stucture plannned is country-->region--->Area--->destination--->Airline and then search. if the country is selected then the next drop down should show the region automatically in the next dropdown and for the area drop down.The destination drop down should only show destinations for the county selected and the airline should only show the list of airlines. then the rate results should show based on these cliterias. Thanks and Regards Keith Quote Link to comment https://forums.phpfreaks.com/topic/279107-help-in-creating-a-search-form/ Share on other sites More sharing options...
gristoi Posted June 13, 2013 Share Posted June 13, 2013 the forum is to help people who are having problems with their coding, not to do the work for them. if you want someone to complete your code then your best moving this to the freelancing section Quote Link to comment https://forums.phpfreaks.com/topic/279107-help-in-creating-a-search-form/#findComment-1435714 Share on other sites More sharing options...
Barand Posted June 13, 2013 Share Posted June 13, 2013 the stucture plannned is country-->region--->Area--->destination--->Airline Your data tables do not reflect that structure, it is more like country--+--> area | +--> region | +--> destination ----> rates <----- airline Quote Link to comment https://forums.phpfreaks.com/topic/279107-help-in-creating-a-search-form/#findComment-1435779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.