Count rows

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

Post Reply
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

Count rows

Post by ampersand »

I've made a database so I can keep track of what all my cd's contains, but I need a counter function so I can see how many cd's there are total.

Can anyone help me please ?


Thanks in advance
ampersand
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Letting sql do the work might be the easiest way.
http://www.mysql.com/doc/en/Counting_rows.html
If you're going to fetch them all anyway (again for mysql): mysql_num_rows()
Post Reply