title: SQL Injection and the LIMIT clause
body: <p>This question is to settle an argument between me and a coworker.</p>
  
  <p>Let's say we have the following query, executed on a standard LAMP server.</p>
  
  <pre><code>SELECT field1, field2, field3
  FROM some_table
  WHERE some_table.field1 = 123
  ORDER BY field2 DESC
  LIMIT 0, 15
  </code></pre>
  
  <p>Now let's assume the limit clause is vulnerable to SQL injection.</p>
  
  <pre><code>LIMIT [insert anything here], [also insert anything here]
  </code></pre>
  
  <p>The point of my coworker is that there is no way to exploit this injection, so there's no need to escape it (since it take more processing power and stuff).</p>
  
  <p>I think her reasoning is stupid, but I can't figure out how to prove her wrong by finding an example.</p>
  
  <p>I can't use <code>UNION</code> since the query is using an <code>ORDER BY</code> clause, and the MySQL user running the query doesn't have the <code>FILE</code> priviledge so using <code>INTO OUTFILE</code> is also out of the question.</p>
  
  <p>So, can anyone tell us who is right on this case?</p>
  
  <p><strong>Edit</strong>: the query is executed using PHP, so adding a second query using a semicolon won't work.</p>