title: php - count total num rows inside while loop
body: <p>I've got this piece of code:</p>
  
  <pre><code>  $i=0;
        $start_date = date("Y/m/d");
        $end_date = date('Y/m/d', strtotime($start_date . " -7 days"));
  
  
  
        while($days7=mysql_fetch_assoc($q)): 
            $next_date = strtotime($i--." days", strtotime($start_date));
            $date = date("Y/m/d",$next_date); 
        #Let's get the latest click combined from the latest 7 days
            $combined7=mysql_query("SELECT sum(value) FROM `xeon_stats_clicks` WHERE user='".$userdata['username']."' AND typ='4' AND data='$date' ORDER BY data DESC LIMIT 8") or die(mysql_error());              
  
  
        print mysql_num_rows($combined7);
  
        endwhile;  
  </code></pre>
  
  <p>I need to see how many rows that <code>$combined7</code> is getting.
  Currently, I am using <code>print mysql_num_rows($combined7);</code> but that just prints out: 1 1 1 1 1 (The number '1' for each row)</p>
  
  <p>How can I count the total number?</p>
  
  <p>(P.S. $i have to be set to 0)</p>