10-20-2008, 06:51 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Nov 2007
Location: Edinburgh
Posts: 21
Thanks: 1
|
Fetching top amount of keywords

Im looking for a way to show the results of this database like this:
Top Keywords- Code
- MySQL
- poop
- ass
Because, if you look at screenshot, Code has 3 entries ( so #1 ) MySQL has two entries ( #2 ) and then the rest under it :)
I have this so far, but it doesnt work :(
Code:
$q = mysql_query("SELECT COUNT(`id`) AS freq, `name` FROM `table` GROUP BY `name` ORDER BY freq ASC");
echo '<ul>';
while($fetch = mysql_fetch_array) {
echo '<li>'.$fetch["name"].'</li>';
}
echo '</ul>';
Thanks in advance.
|
|
|
|