I want to count some rows in my database and I'm using the following code:
$tagname = Person;
$query = "SELECT COUNT(thread_tag_map.tag_id) AS tagcount
FROM tags, thread_tag_map
WHERE thread_tag_map.tag_id = tags.id
AND tags.name = '$tagname'";
$result = $this->do_query($query);
return $result;
When I use print_r($result) it shows an associative array Array ( [tagcount] => 3 ).
Shouldn't it be a mysqli object that I have to extract using mysqli_fetch_assoc?
Could someone explain?