- Forums
- MySQL
- How To Count Number Of Rows In A Mysql Query Get Total Count Rows
This Page Contains information about How To Count Number Of Rows In A Mysql Query Get Total Count Rows By wallpaperama in category MySQL with 3 Replies. [889], Last Updated: Sat May 18, 2024
wallpaperama
Mon Feb 18, 2008
3 Comments
10441 Visits
lets say you want to get the total number of queries in a mysql database.
for example, i have a forums and i want to know how many replies the topic number 455 has recieved, i can use this:
$sql = "SELECT COUNT(reply) WHERE topic='455'"
$row = mysql_fetch_row($result);
$count = $row[0];
TEMPLATE:
$sql = "SELECT COUNT (field) WHERE field='$velue'"
$result = mysql_query($sql ,$db);
$row = mysql_fetch_row($result);
$count = $row[0];