title: MySQL sort order by array value
body: <p>I need to run a MySQL query where the order is determined by an array value.</p>
  
  <p>My array is variable but the values in the array correspond to a field in my DB table called 'ID' so I want the result to be returned in the ID order 9, 1, 4.</p>
  
  <pre><code>Array ( [0] =&gt; 9 [1] =&gt; 1 [2] =&gt; 4 )
  </code></pre>
  
  <p>Is this possible in MySQL or would it be possible to sort the MySQL $result using the array after?  You can assume the only values being returned are those in the array.</p>