Original Post
Hello everyone, I am working on a website and I am encountering a problem. So this website page lets people Order Replacement Parts. I have been told to make it a specific way, everything worked up until the point I need help with. The screen first asks how many parts you would like to order. The entered information gets sent to $PartNum and then it executes for($i=1;$i<=$PartNum;$i++) inside of the for loop, there are two select boxes. The first select box runs a mysql query that displays all products through $sql='select * from service_products'; $rresult=mysql_query($sql); while($arr=mysql_fetch_row($rresult)){ echo ''; The value is Product. This all works. The part I am having trouble with is the second select box. Using Java code: function submitform() { document.myform.submit(); } I make it so that after you select the product it updates the page. Then I have to display the second select box with this query: $sql2='select * from service_parts where Product ='.$Product; Except because it is in a for loop, it executes the query before it can store information in $Product. How can I make it so that after you select a product from the first select box, the second select box will then fill with the query that selects parts?