Location: PHPKode > projects > Axis Groupware > musiclib/unused/tunez/browse_genre.php
<?
# browse.php
#
# Lists songs alphabetical and lets user vote.

include ("tunez.inc.php");

$title = "Browse by genre";
include ("header.inc.php");



$kweerie = "select *, count(*) as aantalSongs from songs LEFT JOIN genres using(genre) group by genrename order by genrename";
$result = mysql_db_query("tunez", $kweerie);

$text .=  "<table width=300><tr><td valign=top>";

$breakpoint = ceil((mysql_numrows($result) / 2));
$breakpoint++;

while ($row = mysql_fetch_array($result)) 
{
	$a++;
	if ($a == $breakpoint) { $text .= "</td><td valign=top>"; } 
	$genre_id = $row[genre];
	$genrename = $row[genrename];
	$aantalSongs = $row[aantalSongs];
	if ($genrename > '')
	{
		$text .= "<a href=\"browse_genre.php?genre=$genre_id\" class=nav>$genrename</a> ($aantalSongs)<BR>";
	}
} 

$text .=  "</td></tr></table>";

showBox ("Browse the songs by genre", $text);


if (isset($genre))
{
	$kweerie = "SELECT * from songs WHERE genre='$genre' ORDER BY artist, songtitle ";
	listSongs($kweerie, "nee", "ja");
}

include ("footer.inc.php");
?>
Return current item: Axis Groupware