Page 1 of 1

[SOLVED] Determing Row Count

Posted: Wed Sep 01, 2004 12:34 pm
by Burrito
I need to know how many rows a query is returning...is there a built in function to do this?

I know I could do this:

Code: Select all

<?php
$count = 0;
while($row = mysql_fetch_assoc($queryname)){
$count = $count + 1;
}

?>
but that seems like a bloated way of doing things...I'm thinking there's got to be something easier that's built in....

please advise,

thx,

Burr

Posted: Wed Sep 01, 2004 12:42 pm
by feyd
[php_man]mysql_num_rows[/php_man] and [php_man]mysql_affected_rows[/php_man]

Posted: Wed Sep 01, 2004 12:56 pm
by Burrito
perfect, thank you.

Burr