title: Doing a while / loop to get 10 random results
body: <p>Hello i'm trying to make a tag script for my website so each time a search engine comes to my website 10 different tags will show on my website.</p>
  
  <p>These tags will be grabbed from the db.
  So at the minute i have coded it so it grabs only one. ( because i don't know how to do a <code>while</code> )</p>
  
  <p>Like so</p>
  
  <pre><code>$sql = "SELECT tagname FROM tags ORDER BY rand() LIMIT 10";
  $result = mysql_query($sql);
  $row = mysql_fetch_object($result);
  echo "&lt;a href='index.php'&gt;" .$row-&gt;tagname. " &lt;/a&gt;";
  </code></pre>
  
  <p>Is there anyway i can add a while to that so it does it 10 times ?  E.g use the same echo but print out 10 results instead of the 1 .... i have changed the limit from 1 to 10 but that did not work... still showing one...</p>