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];