title: PHP- Fetch from database and store in drop down menu html
body: <p>I can't seem to get the following code to make a dropdown menu that contains data from a mysql database. The "include('connect.php');" connects to the mysql database and I know it works on separate pages. Any suggestions?    </p>
  
  <p>Below is the entire code.
       
       
       
       listCustomer
       
       
       </p>
  
  <pre><code> &lt;BODY&gt;
   &lt;H1&gt;Find Customer's Albums Page&lt;/H1&gt;
   From a dropdown list of customers, a user should be able to pick a customer and see a list of     albums (all fields in the CD table) purchased by that customer.
   &lt;HR&gt;
   &lt;FORM ACTION="listCustomer.php" METHOD="POST"/&gt;
   Customer:
   &lt;select name="mydropdownCust"&gt;
   &lt;option value="101"&gt;101&lt;/option&gt;
   &lt;option value="102"&gt;102&lt;/option&gt;
   &lt;option value="103"&gt;103&lt;/option&gt;
   &lt;option value="104"&gt;104&lt;/option&gt;
   &lt;option value="105"&gt;105&lt;/option&gt;
   &lt;option value="106"&gt;106&lt;/option&gt;
   &lt;option value="107"&gt;107&lt;/option&gt;
   &lt;option value="108"&gt;108&lt;/option&gt;
   &lt;option value="109"&gt;109&lt;/option&gt;
   &lt;option value="110"&gt;110&lt;/option&gt;
   &lt;/select&gt;
   &lt;BR&gt;
  
   &lt;?php
   include('connect.php');
  
   $query = "SELECT Cnum, CName FROM Customer";
   $result = mysql_query ($query);
   echo "&lt;select name=dropdown value=''&gt;Dropdown&lt;/option&gt;";
   while($r = mysql_fetch_array($result))
   {
   echo "&lt;option value=$r["Cnum"]&gt;$r["CName"]&lt;/option&gt;"; 
   }
   echo "&lt;/select&gt;";
   ?&gt;
  
   &lt;BR&gt;
   &lt;INPUT TYPE="SUBMIT" Value="Submit"/&gt;
   &lt;/FORM&gt;
  
   &lt;FORM ACTION="listMenu.html" METHOD="POST"/&gt;
   &lt;INPUT TYPE="SUBMIT" Value="Main Menu"/&gt;
   &lt;/FORM&gt;
   &lt;/BODY&gt;
   &lt;/HTML&gt;
  </code></pre>