title: progress bar with mysql query with php
body: <p>i am trying to update a progress bar with the iteration of a mysql query, and i can't understand how i can update the progress bar, and how i can found what number of row i have fetched, for example:</p>
  
  <pre><code>$query = 'SELECT tvshows.genres, tvshows.id_show FROM tvshows where tvshows.genres is not NULL';
  $result = mysql_query($query);
  
  $num_rows = mysql_num_rows($result);
  echo $num_rows;
  </code></pre>
  
  <p>this: <code>echo $num_rows;</code> is the number of rows i have fetched, and then in this way i iterate the result:</p>
  
  <pre><code>while ($db_row = mysql_fetch_assoc($result)) 
  {
      //Do seomthing with the row
  
  }
  </code></pre>
  
  <p>but how i can know in what row i fetch to update then the progress bar? and anyone knows a good tutorial or sample code to do a progress bar? i have found this: <a href="http://w3shaman.com/article/php-progress-bar-script" rel="nofollow">http://w3shaman.com/article/php-progress-bar-script</a></p>
  
  <p>but that example require these: </p>
  
  <pre><code> for($i=1; $i&lt;=$total; $i++){
  // Calculate the percentation
  $percent = intval($i/$total * 100)."%";
  </code></pre>
  
  <p>and i doesn't know how make it with the result of the php query, anyone can help me?</p>