title: SQL LIMIT syntax error
body: <p>So here is the whole thing: </p>
  
  <pre><code>SELECT * FROM sometable LIMIT 5*DATEDIFF(NOW(), '2011-08-30'), 5
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near '*DATEDIFF(NOW(), '2011-08-30'), 5' at line 1</p>
  </blockquote>
  
  <p>The problem is clearly that <code>LIMIT</code> does not accept anything but integer apparently. It won't accept <code>1+1</code> or <code>(1+1)</code> as value either. Is there a way around it? </p>
  
  <p>And just so you don't have to go and try, <code>5*DATEDIFF(NOW(), '2011-08-30')</code> works just fine.</p>
  
  <p>I am trying to fix <a href="https://stackoverflow.com/questions/6601117/how-to-make-quote-of-the-day-using-php-and-mysql-in-order-by-id">this</a> answer..</p>