title: Click Button To Fill Listbox
body: <p>I am trying to fill a listbox on a webpage and I want the listbox to start blank.  Once the button is clicked the listbox should populate.  My code below automatically fills the listbox but I would rather have the button do it.</p>
  
  <pre><code>&lt;?php 
  $dbc = mysql_connect('','','') 
       or die('Error connecting to MySQL server.'); 
  
  mysql_select_db('MyDB'); 
  
  $result = mysql_query("select * from tblRestaurants order by RestName ASC"); 
  ?&gt; 
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; 
  
  &lt;head&gt; 
  
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; 
  
  &lt;title&gt;SEARCH&lt;/title&gt; 
  
  
   &lt;/head&gt; 
  
  &lt;body&gt; 
  &lt;form method="post" action="1004mcout.php"&gt;
  
  
  
  &lt;p&gt;&lt;center&gt;SEARCH&lt;/CENTER&gt;&lt;/P&gt; 
  &lt;select name="RestName"&gt; 
  &lt;?php 
   while ($nt= mysql_fetch_assoc($result))  
  { 
       echo '&lt;option value="' . $nt['RestID'] . '"&gt;' . $nt['RestName'] . '&lt;/option&gt;'; 
  }  
  ?&gt; 
  &lt;/select&gt;
  
  &lt;p&gt; SPACE&lt;/p&gt; 
  
  &lt;p&gt;Click "SUBMIT" to display the calculation results&lt;/p&gt; 
  
  &lt;input type="submit" name="Submit" value="Submit" /&gt; 
  
  &lt;br /&gt; 
  
  &lt;/form&gt; 
  
  &lt;/body&gt; 
  
  &lt;/html&gt; 
  </code></pre>