How To Count Number Of Rows In Mysql Database Query
how to count number of rows in mysql database query
how, to, count, number, of, rows, in, mysql, database, query
How To Count Number Of Rows In Mysql Database Query
Post Description: how to count number of rows in mysql database query
POST# 1329
Posted On: Sat Apr 26, 2008 3:50 pm
Webune
Topic: How To Count Number Of Rows In Mysql Database Query
lets say you want to find out how many users you have that are registered..

for example, i have a table called users and a field called confirmed and i want to do a query of the number of users who have been confirmed

this is an example query i would use

PHPCODE:
$sql = "SELECT username FROM users WHERE confirmed='yes'";
$result = mysql_query($sql ,$db);
$confirmedusers= mysql_num_rows($result);


as you can see, the mysql_num_rows() functions does this trick well
Share:
BBCODE:
HTML Code:


No Repies
(0) Comments for How To Count Number Of Rows In Mysql Database Query

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload
     
  1. How To Count Number Of Rows In Mysql Database Query