i put the following code
<?
mysql_connect("localhost");
mysql_select_db("announcements_system");
$start = microtime();
$result=mysql_query("SELECT * FROM post");
$num=mysql_num_rows($result);
$end = microtime();
print "<br /><br />First Section took ". max($end,$start)-min($end,$start) ." seconds.";
echo "<br>";
$start = microtime();
$result=mysql_query("SELECT count(*) FROM post");
$row=mysql_fetch_assoc($result);
$end = microtime();
print "<br /><br />First Section took ". max($end,$start)-min($end,$start) ." seconds.";
?>
results :
-0.184668 seconds
-0.194973 seconds
-0.33486 seconds.
-0.342905 seconds.
-0.944245 seconds.
-0.149666 seconds.
-0.485084 seconds.
-0.495755 seconds.
I can't consinder any of these method faster than the other.
Most of times they are identicals.
Your opinion?