I’m a graphic designer by trade and this php stuff might as well be written in Chinese. I’m trying to create a php app that will allow users of my website to search products using 2 selection boxes to return a list of specifications/information based on their selection. So far, I’ve been able to only successfully create one drop down. Here’s the code I have for that:
<?php /* Program: selecttrailer.php * Desc: Displays list of trailer models from the database. */ $user="root"; $host="localhost"; $passwd="xxxxxxx"; $database="trailers"; $cxn = mysqli_connect($host,$user,$passwd,"trailers") or die("Couldn't connect to server"); $query="SELECT DISTINCT tnttrailer_brand FROM trailerquote ORDER BY tnttrailer_brand"; $result = mysqli_query($cxn,$query); ?> <?php while ($row = mysqli_fetch_assoc($result)) { extract($row); echo "$tnttrailer_brand\n"; } ?>What I need help with is the creation of another list that is dependent upon the first. It should return the model numbers (named “tntmodel_number” in my database) associated with tnttrailer_brand selected from the first list. Then, the second selection needs to list the other values associated with the model number in a table or list or whatever.
I hope this makes sense to someone. And thanks in advance for any help with this.