title: How to select first row then other rows from a single mysql query?
body: <p>I may be missing the obvious, how could I return the results I need? Take a look at this simple example:</p>
  
  <pre><code>
  $fetch_image = "SELECT image_url FROM table"; //returns about 10 rows
  $stmt_img = $db-&gt;prepare($fetch_image);
  $stmt_img-&gt;execute();
  $stmt_img_result = $stmt_img-&gt;get_result();
  
  while ($row_img = $stmt_img_result-&gt;fetch_assoc()) {
       $image = $row_image['image_url'];
       echo 'Image url: '.$image.'&lt;br&gt;'; //this will echo out 10 times.
  }
  </code></pre>
  
  <p>The above code iterates through all 10 rows. How could I return the first row from the result set, and then the other 9 rows?</p>
  
  <p>Edit: I'm trying to create an image previewer so that the first image shows up as the placeholder/main image then the other 9 rows show up as the thumbnails, something like this:</p>
  
  <pre><code>&lt;div class="sp-wrap"&gt;
              &lt;a href="images/1.jpg"&gt;
                  &lt;!-- This would be the placeholder/main/first image from the mysql result set --&gt;
                  &lt;img src="images/1_tb.jpg" alt=""&gt;
              &lt;/a&gt;
              &lt;!-- In real life these would be dynamically generated --&gt;
              &lt;a href="images/3.jpg"&gt;&lt;img src="images/3_tb.jpg" alt=""&gt;&lt;/a&gt;
              &lt;a href="images/4.jpg"&gt;&lt;img src="images/4_tb.jpg" alt=""&gt;&lt;/a&gt;
              &lt;a href="images/5.jpg"&gt;&lt;img src="images/5_tb.jpg" alt=""&gt;&lt;/a&gt;
              &lt;a href="images/6.jpg"&gt;&lt;img src="images/6_tb.jpg" alt=""&gt;&lt;/a&gt;
          &lt;/div&gt;
  </code></pre>