- Forums
- MYSQL
- How To Count Number Of Rows In Mysql Database Query
This Page Contains information about How To Count Number Of Rows In Mysql Database Query By Webune in category MYSQL with 0 Replies. [2288], Last Updated: Mon Jun 24, 2024
Webune
Sat Apr 26, 2008
0 Comments
344 Visits
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