$query = "select count(*)
from relationships
where leader = 'user_id'";
$result = mysql_query($query);
how can i display the count? thanks
$query = "select count(*)
from relationships
where leader = 'user_id'";
$result = mysql_query($query);
how can i display the count? thanks
$query = "SELECT COUNT(*) AS total FROM table"; $result = mysql_query($query); $values = mysql_fetch_assoc($result); $num_rows = $values['total']; echo $num_rows;
$row = mysql_fetch_array($result)
and access it by index 0: $row[0]$row = mysql_fetch_assoc($result)
and access it by name: $row['cnt']