title: display data from database on selecting 'ALL'option from dropdownlist
body: <p>I have one dropdown list populating from a database table A. When user select an option and click 'go', related data with that category will display on page from another database table B.Like this, when user select 'ALL' option from dropdown list and click 'Go', It should display all the data from B table. </p>
  
  <p>The page will always display data regarding first option with page load which loads perfectly.</p>
  
  <p>Now,fetching from database table B by selecting list categories are done successfully Except the 'ALL' option. i.e there I'm facing problem when I select 'ALL' category. I am unable to show all the data from table B at a time. Help me please and ignore If I write some wrong english. Here is my code:</p>
  
  <pre><code>&lt;div align="right"&gt;&lt;label&gt;Category&lt;/label&gt;
  
  &lt;select name="category"&gt;
  
  &lt;?php
  
  $sql = "SELECT id, art_name FROM category;";
  $result = mysql_query($sql);
  while ($row = mysql_fetch_assoc($result)) {
  ?&gt;
  &lt;option value="&lt;?= $row['id']; ?&gt;"&lt;?=($_POST['category']==$row['id'] ? '   selected="selected"' : '')?&gt;&gt;&lt;?= $row['art_name']; ?&gt;&lt;/option&gt;
  
  &lt;?php } ?&gt;
  &lt;/select&gt;
   &lt;input name="go" type="submit" value="Go" /&gt;&lt;/div&gt;
   &lt;div align="center" class="showimage"&gt;
   &lt;ul class="display"&gt;
  
  &lt;?php
  $id = $_POST['category'];
  $search = mysql_query("SELECT id, categoryid, path FROM list WHERE categoryid = $id");
   $sql = mysql_query("SELECT autodisplay FROM list WHERE categoryid = 2");
  $sql_search = mysql_query("SELECT path FROM list");
  if (isset($_POST['go'])) {
  while ($row = mysql_fetch_assoc($search)) {
  ?&gt;
  
  &lt;li&gt;&lt;a href="&lt;?= $row['path']; ?&gt;" class="highslide" onclick="return hs.expand(this)"&gt;&lt;img src="&lt;?= $row['path']; ?&gt;" border="0"&gt;&lt;/a&gt;
  &lt;/li&gt;
  &lt;?php }
  while ($row = mysql_fetch_assoc($sql_search)) {
  ?&gt;
  
  &lt;li&gt;&lt;a href="&lt;?= $row['path']; ?&gt;" class="highslide" onClick="return hs.expand(this)"&gt;&lt;img src="&lt;?= $row['path']; ?&gt;" border="0"&gt;&lt;/a&gt;
   &lt;/li&gt;
  &lt;?php }
   }
  
   else {
   while ($row = mysql_fetch_assoc($sql)) {
   ?&gt; 
   &lt;li&gt;&lt;a href="&lt;?= $row['autodisplay']; ?&gt;" class="highslide" onclick="return hs.expand(this)"&gt;&lt;img src="&lt;?= $row['autodisplay']; ?&gt;" border="0"&gt;&lt;/a&gt;
  
   &lt;/li&gt;
   &lt;?php }
  
   }
   ?&gt;
  
  &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><a href="http://monomita.arbionics.com/Becuart/Site/DOCS/test.php" rel="nofollow">And this is the link of my running page:</a></p>