title: How do I search my MYSQL database from an auto populated drop down menu?
body: <p>I am a complete newbie, and this is the first post i have made in one of these forums. So if i dont explain myself properly or am not supposed to ask questions like this, then please forgive me and try to be patient with me :)</p>
  
  <p>Basically, i have set up a mysql database and i can populate it from my website. I have created a basic search option where i would like to chose an option from a dropdown and also be able to type in a keyword. I have figured out hte keyword part i am just a bit confused as to how to work the drop down side of things. I have searched the internet for answers but im not sure im using the correct terminology and therefore im finding it hard to sort out this problem. </p>
  
  <p>I have created a basic MYSQL database before and made it work before, so i can only assume the problem is with the auto populated drop down.  </p>
  
  <p>Let me explain..... i have a serach page imaginatively titled "Search.php" which contains a form which consists of a drop down menu and a text box (dont worry about the text box - that works fine), the drop down box is automatically populated from my MYSQL databse, and when the form is submitted the results should appar on another page, titled "Results.php". For some reason the values from the drop down do not seem to be being passed on to the "Results" page! </p>
  
  <p>Here is the "Search" page drop down box.</p>
  
  <pre><code>&lt;select name="Name" id="Name"&gt;
  &lt;option&gt;Please select&lt;/option&gt;
  &lt;?PHP
  while($row = mysql_fetch_assoc($result))
  {$dropdown .="\r\n&lt;option value='{$row['Name']}'&gt;{$row['Name']}&lt;/option&gt;";}
  echo $dropdown;
  PHP?&gt;
  </code></pre>
  
  <p>This all seems to work fine, it auto populates from my MYSQL database and im happy it works.</p>
  
  <hr>
  
  <p>Here is the "Results" page.</p>
  
  <pre><code>&lt;?php 
   mysql_connect('xxxxxxxxxxxx', 'username', 'password') or die(mysql_error()); 
   mysql_select_db("database") or die(mysql_error()); 
  
   $query = "SELECT * FROM Shirts WHERE Name = '$Name'" or die(mysql_error()); 
   $result = mysql_query($query) or die(mysql_error());  
  
   if(mysql_num_rows($result) &gt; 0) {
  
   while($row = mysql_fetch_assoc($result))
   {
    echo ($row['Name']);
    echo "&lt;br /&gt;";
    }
   }
  </code></pre>
  
  <hr>
  
  <p>Shirts = the table name
  Name = the column in the table</p>
  
  <hr>
  
  <p>For some reason this only returns the "Empty" fields in my database, which makes me believe that the values from the dropdown box on the "Search" page are not being passed to the "Results" page!!</p>