Jump to content

[SOLVED] count or num_rows


dreamwest

Recommended Posts

Im using num_rows to cound how many rows there are in a table, but is count(*) faster

 

Heres what im using:

$result3 = mysql_query("SELECT id FROM table WHERE approve='1' ")or die(mysql_error());
$content_count = mysql_num_rows( $result3 );

 

Also i cant seem to get count to work, it only select about 200 rows, but there are over 30,000 rows

 

$content_count = mysql_query("SELECT COUNT(id) FROM table WHERE approve='1' ")or die(mysql_error());

echo $content_count;

 

Link to comment
https://forums.phpfreaks.com/topic/163182-solved-count-or-num_rows/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.