title: PHP MySQL Check If String Contains Query In Only First Few Characters
body: <p>I'm wondering if there is a way to check the first few characters of a string without having to select the string from the database first.</p>
  
  <p>I am making an advanced search feature to add on to my websites search feature. The advanced search feature allows you to search by date. The date in the database looks like <code>2/1/2012</code>. If the user enters <code>February</code>, I convert it to the number <code>2</code>. I then query the database using this line (not the exact line):</p>
  
  <pre><code>mysql_query(SELECT * FROM database WHERE date LIKE '%2%');
  </code></pre>
  
  <p>However, this returns all rows with the number <code>2</code> in the date. I would like to search only the first two characters for the number. Is this possible using a MySQL query, or do I have to do it the longer way?</p>