$total = mysql_num_rows($resultado); while ($row = mysql_fetch_algo($resultado)) // .. echo "Total: $total";