title: With a SELECT...WHERE id IN (...), order results by IN()?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/396748/ordering-by-the-order-of-values-in-a-sql-in-clause">Ordering by the order of values in a SQL IN() clause</a>  </p>
  </blockquote>
  
  
  
  <p>With a query such as:</p>
  
  <pre><code>SELECT * FROM images WHERE id IN (12,9,15,3,1)
  </code></pre>
  
  <p>is it possible to order the results by the contents of the IN clause?</p>
  
  <p>The result I'm looking for would be something like:</p>
  
  <pre><code>[0] =&gt; Array
      (
          [id] =&gt; 12
          [file_name] =&gt; foo
      )   
  [1] =&gt; Array
      (
          [id] =&gt; 9
          [file_name] =&gt; bar
      )   
  [2] =&gt; Array
      (
          [id] =&gt; 15
          [file_name] =&gt; baz
      )
  ...
  </code></pre>