title: MySQL query returns 0 rows in PHP, actual records in phpmyadmin
body: <p>I am trying to get rows from table - specific range of rows to be clear. My query looks like this (just part of the code):</p>
  
  <pre><code>SET @i=0;
  SELECT * FROM images WHERE (@i:=@i+1) BETWEEN 1 AND 10;
  </code></pre>
  
  <p>What is does is get row number of rows and returns rows, whose row number is in given range. When I run this query in phpmyadmin, I can see the result of the query (the actual rows in that range), however the number of rows from query is 0. I am pretty sure the problem is with this part</p>
  
  <pre><code>WHERE (@i:=@i+1)
  </code></pre>
  
  <p>I have searched throught other answers, but the reason was always in php, not the query itself.</p>