jessicahanna214 Posted January 29, 2011 Share Posted January 29, 2011 Hello im pretty new at this and am losing my mind. i have found and tried a lot of the "codes" etc out there with no luck. This will be for an "auto/car search" All the makes/models/prices etc loaded into this form along with zipcodes. Here is the form <form id="SearchForm3" action=""> <div> <label><strong>Make</strong><br /> <select name="makers"> <option>All Makers</option> <option>nissan</option> </select> </label> <label><strong>Model</strong><br /> </label> <label><strong>Maximum P <select name="model"> <option>All Models</option> <option>750</option> </select> rice</strong><br /> <select name="price"> <option>Any</option> <option>20000</option> </select> </label> <div class="container"> <label class="left"><strong>Search Within</strong><br /> <select name="search" class="miles"> <option>50 miles</option> <option>10 miles</option> </select><em>of</em> </label> <label class="zip"><strong>ZIP</strong><br /><input type="text" value="" class="input" /></label> </div> </div> <div class="alignright"> <a href="#" class="link" onclick="document.getElementById('SearchForm').submit()"><strong><strong>search new</strong></strong></a> </div> </form> So i need to put these query results in <?php include ("inc/config.php") ; $sql=" SELECT DISTINCT modelYear, divID, divName, modelName, modelDivID FROM chrome_divisions, chrome_models WHERE modelDivID = divID AND modelYear = 2011 AND divID = '$Make' AND modelName = '$Model' GROUP BY modelYear, divName, modelName; "; $sql="SELECT LogMonth, LogYear FROM Student_MLog WHERE Student_ID='$username'"; $result=mysql_query($sql); while ($row=mysql_fetch_array($result)) { $modelYear=$row["Year"]; $divName=$row["Make"]; $modelName=$row["Model"]; echo "<option>$divName<option/>"; } echo "<select/>"; ?> So once someone clicks "Nissan" Then only nissan models will pull up. Or Chevrolet and only chevy results pull up. From what i understand is that i might need to use AJAX or Java which i cant figure out yet. Anyhelp please!!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/226063-dropdown-menu-from-sql-query-results-auto-makes-models/ Share on other sites More sharing options...
Pikachu2000 Posted January 29, 2011 Share Posted January 29, 2011 I'll edit your post this time, but when posting code, please enclose it in the forum's . . . BBCode tags. Link to comment https://forums.phpfreaks.com/topic/226063-dropdown-menu-from-sql-query-results-auto-makes-models/#findComment-1167008 Share on other sites More sharing options...
kickstart Posted January 29, 2011 Share Posted January 29, 2011 Hi Downloading ALL the makes, models, prices and zip codes is likely to be a lot of data (making the page slow). I would suggest just getting the makes, and when that changes you use javascript for an AJAX call to get the matching list of models for that make (and once the model is selected you go and get a list of those for sale and their prices). All the best keith Link to comment https://forums.phpfreaks.com/topic/226063-dropdown-menu-from-sql-query-results-auto-makes-models/#findComment-1167014 Share on other sites More sharing options...
jessicahanna214 Posted January 30, 2011 Author Share Posted January 30, 2011 i AM NOT SURE WHAT THE RULES ARE IN HERE SO IF I DO THIS WRONG I APOLOGIZE. HERE IS A LINK. http://74.53.124.254/~jessicah/nationaltemplate/used-cars.php TO MY WEBSITE. Link to comment https://forums.phpfreaks.com/topic/226063-dropdown-menu-from-sql-query-results-auto-makes-models/#findComment-1167458 Share on other sites More sharing options...
Pikachu2000 Posted January 30, 2011 Share Posted January 30, 2011 There is a link to the rules at the top of every page: Rules & TOS Link to comment https://forums.phpfreaks.com/topic/226063-dropdown-menu-from-sql-query-results-auto-makes-models/#findComment-1167474 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.