title: Show more than one row MySQL
body: <p>My coding id for search results.</p>
  
  <p>I am showing results from a search, at the moment it will only show the first result, how can i make this show all results that match the search?</p>
  
  <p>Here is my code</p>
  
  <pre><code>      &lt;?php
      $name=$_GET["q"];
      if ($name&lt;=""){echo( "");  
       }
       else
       {
      $con = mysql_connect("localhost","cl49-XXX","XXX");
      if (!$con) 
        {
         die('Could not connect: line 513 ' . mysql_error());
         }
      mysql_select_db("cl49-xxx", $con)or die( "Unable to select database");
      $result=mysql_query("SELECT * FROM products WHERE `prodname` LIKE '$name%' ")or die('Error: Line 519 ('.mysql_error().')' );
  
      $row = mysql_fetch_array($result);
      $prodID=$row['prodID'];
      $prodname=$row['prodname'];
      $catagory=$row['catagory'];
      }
      echo"
       &lt;div class='row-fluid portfolio-block'&gt;
      &lt;div class='span5 portfolio-text'&gt;
      &lt;img src='userpics/$prodID.jpg' height='80' width='80' alt='' /&gt;
      &lt;div class='portfolio-text-info'&gt;
                                                  &lt;h4&gt;$prodname&lt;/h4&gt;
      &lt;p&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;/div&gt;
      &lt;div class='span5'&gt;
  &lt;div class='portfolio-info'&gt;
  Product ID
                                                  &lt;span&gt;$prodID&lt;/span&gt;
          &lt;/div&gt;
    &lt;div class='portfolio-info'&gt;
                                                  catagory
                                                  &lt;span&gt;$catagory&lt;/span&gt;
   &lt;/div&gt;
   &lt;/div&gt;
    &lt;div class='span2 portfolio-btn'&gt;
    &lt;a href='edit_product.php?q=$prodID' class='btn bigicn-only'&gt;&lt;span&gt;View&lt;/span&gt;&lt;/a&gt;                                
      &lt;/div&gt;
      &lt;/div&gt; ";
  
     ?&gt;
  </code></pre>
  
  <p>Any help would be great!</p>