title: Comparison and $i++ in a while
body: <p>I have a while loop <code>while ($row = $result-&gt;fetch_assoc()) {$i++ }</code></p>
  
  <p>And then I want to do something like: </p>
  
  <pre><code>if ($i == 5 &amp;&amp; the total number of items is more than 10) {do this}
  </code></pre>
  
  <p>In other words, if the increment goes to 10+ then $i == 5 should do something else do nothing</p>