title: MySQL ORDER BY 'ENUM' type value
body: <p>I'm having a table:</p>
  
  <pre><code>ID    TYPE     VALUE
  1     phone    12345
  2     fax      98753
  3     address  etc
  ...
  </code></pre>
  
  <p>the <code>TYPE</code> col is defined as <code>ENUM</code> with values: <code>'phone','fax','address'</code>.</p>
  
  <p>Now my query is:</p>
  
  <pre><code>$q = mysql_query(SELECT * FROM tbl ORDER BY id);
  while(row = mysql_fetch_array($q)){
      echo $row['type'] . "---&gt;" . $row['value'];
  }
  </code></pre>
  
  <p>The output is ordered by id, first line is <code>phone</code>, then it's <code>fax</code> and then it's <code>address</code>.</p>
  
  <p>But I want the output be order by:</p>
  
  <p>1- All <code>address</code>
  2- All <code>Phone</code>
  3- All <code>fax</code></p>
  
  <p>How I could achieve this?</p>
  
  <p>Thanks for your help :-)</p>