title: How to only display sql record once during while statement
body: <p>I am running a <code>while</code> statement to display a image of an artist in my database. At the moment, it displays the same image multiple times rather than once. How can I make it so the image is shown once and not multiple times?</p>
  
  <p>Here`s my code :</p>
  
  <pre><code>&lt;?
  while ($feed = mysql_fetch_object($query)) { ?&gt;
  &lt;?
      if ($count == '4') {
          $count = 0; ?&gt;
  
          &lt;div class="blog_item"&gt;
          &lt;div class="preview_wrapper"&gt;
          &lt;div class="featured_image_full"&gt;
  
  &lt;?
          $query1 = mysql_query("SELECT * FROM `Artists` WHERE `Genre1` = '$usr-&gt;Genre1' OR `Genre2` = '$usr-&gt;Genre1' OR `Genre3` = '$usr-&gt;Genre1' OR `Genre1` = '$usr-&gt;Genre2' OR `Genre2` = '$usr-&gt;Genre2' OR `Genre3` = '$usr-&gt;Genre2' OR `Genre1` = '$usr-&gt;Genre3' OR `Genre2` = '$usr-&gt;Genre3' OR `Genre3` = '$usr-&gt;Genre3' ORDER BY RAND() LIMIT 0,1");
  
          while ($art = mysql_fetch_object($query1)) { ?&gt;
              &lt;img src="&lt;? echo $art-&gt;image; ?&gt;"&gt;
          &lt;? } ?&gt;
  </code></pre>