Here i get mos popular hashtags (mos used hashtags) but problem is with comma my query show this:
Popular hashtags:
#q7 (2)
#q9 (2)
#q7 , #q0 (1)
#q0 (1)
I want this:
Popular hashtags:
#q7 (3 times )
#q9 (2 times)
#q0 (2 times)
my code:
$query_result = mysqli_query($Connection, "select hashtag, count(hashtag) as cnt
from tricks
group by hashtag
order by cnt desc limit 5");
$results = array();
while($row = mysqli_fetch_assoc($query_result)) {
$results[] = "{$row['hashtag']} ({$row['cnt']})";
}
echo "Popular hashtags: </br>", implode("</br>", $results);