ik heb in mijn online table al die info staan nu doe ik het volgende:
$query = mysql_query("SELECT DISTINCT pagina FROM online WHERE pagina > '' ORDER BY pagina DESC") or die(mysql_error());
while($var = mysql_fetch_object($query))
{
$aantal = mysql_num_rows(mysql_query("SELECT pagina FROM online WHERE pagina = '". $var->pagina ."'"));
echo "
<tr>
<td><strong>". $aantal ."</strong></td>
<td>". $var->pagina ."</td>
</tr>
";
}
met dit als output:
Aantal Bezochte Pagina's
1 Within Temptation - Stand My Ground
1 Waterqueen - We Will Rock You
2 Usher - Confessions Part 2
1 Usher & Alicia Keys - My Boo
2 U2 - Vertigo
1 Terror Squad & Fat Joe - Lean Back
3 Superclip
3 Special D - You
1 Special D - Come With Me
2 Natasha Bedingfield - These Words
1 Michael Jackson - Black Or White
1 Michael Grey - The Weekend
1 Maud - Zoals Je Naar Me Kijkt
2 Marco Borsato & Ali B - Wat Zou Je Doen
1 Madonna - Frozen
....
hoe kan ik er voor zorgen dat het word gesorteerd op aantal?
em dat zou niet kunnen ;) omdat het zo in mijn database staat:
100375 0 ip 1100282391 1100282391 Home <img src="pictures/winxp.png" width="14" height="1... <img src="pictures/ie6.png" width="14" height="14"...
100359 0 ip 1100282718 1100282206 Scooter - Posse (I Need You On The Floor) <img src="pictures/winxp.png" width="14" height="1... <img src="pictures/ie6.png" width="14" height="14"...
100349 0 ip 1100282326 1100282065 Eminem - Just Lose It <img src="pictures/winxp.png" width="14" height="1... <img src="pictures/ie6.png" width="14" height="14"...
100309 0 ip 1100282684 1100281564 Justin Timberlake - Like I love you <img src="pictures/winxp.png" width="14" height="1... <img src="pictures/ie6.png" width="14" height="14"...
100395 0 ip 1100282628 1100282614 Danzel - Pump It Up <img src="pictures/winxp.png" width="14" height="1... <img src="pictures/ie6.png" width="14" height="14"...
100333 0 ip 1100282165 1100281895 Home <img src="pictures/unknown.png" width="14" height=... <img src="pictures/ie6.png" width="14" height="14"...