title: Saving file mime type in database using php/mysql
body: <p>I save file path in database with a title and short description<br/></p>
  
  <pre><code>id   file   title   desctiption   date
  </code></pre>
  
  <p>here, I want to filter the table by file type<br/>
  what is the best method should I use?<br/><br/>
  <strong>method 1 :</strong> save the file extension in a new field<br/>
  <strong>method 2 :</strong> save the file mime type in a new field<br/>
  <strong>method 3 :</strong> using mysql search in file name in the current file field as "%.jpg"</p>
  
  <p>I think that wordpress uses method 2 , It stores the attachment mine type in posts table
  <br/>
  Thanks and sorry for bad english</p>