title: SQL how to get a result from between a set of date without knowing the specific date?
body: <p>I am sending a HTTP request to my PHP file using javascript, I get the date by using the normal getDate() function, however I dont know what that day is since each day it will be a different date.</p>
  
  <p>What I need is a SQL query that checks the date, and return any values from that date plus any results from 2 days before and two days after, is there such a query for this?</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT col FROM somewhere WHERE MY_DATE = 'VARIABLE_WITH_DATE' BETWEEN 2 days before and 2 days after VARIABLE_WITH_DATE
  </code></pre>
  
  <p>Its important to keep in mind that I dont know what date it is, ofcourse if I knew the date I could do a SQL query much easier.</p>
  
  <p>I can do some hack on javascript to fix this issue, but would be nice to know if there is such a SQL query.</p>
  
  <p>Im using MySql</p>
  
  <p>Thanks</p>