PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Wed Sep 01, 2004 12:34 pm
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Sep 01, 2004 12:42 pm
[php_man]mysql_num_rows[/php_man] and [php_man]mysql_affected_rows[/php_man]
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Wed Sep 01, 2004 12:56 pm
perfect, thank you.
Burr