get data from 2 dropdownlist after submitting the form in php
<p>Ive been searching around here to find an answer but I cannot find one :).
My issue I have 2 dropdownlist "manufacturers" and "models". This is for an aircraft directory. What I want is after the user select a manufacturer and model and click "submit", they will be redirected to a page and show the information about a certain aircraft that belongs to that certain manufacturer and model. Just for clarification, I want to show that data after the user click the submit button. I saw a lot of tutorials about getting data from the dropdownlist but all of them used "onchange" for getting and displaying the value from the dropdownlist.</p>

<p>here is the code:</p>

<pre><code>&lt;form name="psform" action="pistonsingle.php" method="post"&gt;
         &lt;?php 
            $display = displaymaincat(1);
            while($result=mysql_fetch_array($display)){
                echo $result['maincategory'];  
            }
          ?&gt;
         &lt;?php 
           $display = mysql_query("SELECT * FROM manufacturers");
            confirm_query($display);
            echo "&lt;select name=\"manu\"&gt;";
            echo "&lt;option&gt; --Select Manufacturer--&lt;/option&gt;";
            while($result=mysql_fetch_array($display)){
             echo "&lt;option value=$result[id]&gt;$result[manufacturer] &lt;/option&gt;";};
             echo "&lt;/select&gt;";
         ?&gt;
         &lt;?php 
             $display = mysql_query("SELECT * FROM models");
            confirm_query($display);
            echo "&lt;select name=\"models\"&gt;";
             echo "&lt;option name=\"nullsel\"&gt; --Select Model--&lt;/option&gt;";
            while($result=mysql_fetch_array($display)){
             echo "&lt;option value=$result[id]&gt;$result[model] &lt;/option&gt;";};
             echo "&lt;/select&gt;";
         ?&gt;
         &lt;input type="submit" name="psbutton" id="button" value="Show Listing"  /&gt;
         &lt;/form&gt;
</code></pre>

<p>Then I try to use this function that i make on the action page
function psdisplay(){</p>

<pre><code>        if(isset($_POST['submit'])){
        $display = mysql_query("SELECT * FROM individualaircraft 
        INNER JOIN aircraftmaincat on individualaircraft.maincategory_id = aircraftmaincat.id
        INNER JOIN manufacturers on individualaircraft.manufacturer_id = manufacturers.id
        INNER JOIN models on individualaircraft.model_id = models.id
        WHERE maincategory_id = 1");
        confirm_query($display);
        return $display;
    }
        }
</code></pre>

<p>
    

<pre><code>?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php 
        $display = psdisplay();
        while($result=mysql_fetch_array($display)){
            echo $result['generalinformation'];
        }
?&gt;&lt;/td&gt;
&lt;td&gt;&lt;?php 
    $display = psdisplay();
        while($result=mysql_fetch_array($display)){
            echo $result['website'];
        }

?&gt;&lt;/td&gt;
</code></pre>

<p></p>

<p>its working. it displays the data but the problem is when the user click the submit button even he/she select a certain manufacturer or model, what my code do is just display all the aircrafts and not a certain aircraft that belong to a certain manufacturer and model.</p>

<p>I hope somebody can help me :). Thanks in advance.</p>

<p>Keyframer</p>
