5 echo "<h3>Artists</h3>\n<p>";
8 if ( isset($search) ) {
9 $where = "(artist ~* :search OR album ~* :search OR title ~* :search OR path_name ~* :search) ";
10 $params[':search'] = $search;
14 $where .= ($where == ''?
'' : ' AND ');
15 $where .= '(artist ~ :artist_match)';
16 $params[':artist_match'] = '^'.$altr;
18 if ( $where != '' ) $where = 'WHERE '. $where;
19 $sql = 'SELECT distinct ON (lower(artist)) artist FROM tracks '.$where.' ORDER BY lower(artist)';
20 $qry = new AwlQuery( $sql, $params );
22 if ( $qry->Exec('artist') && $qry->rows() > 0 ) {
23 while ( $artist = $qry->Fetch() ) {
24 $display = htmlspecialchars($artist->artist
);
25 if ( trim($display) == "" ) $display = "«unknown»";
26 echo " <a href=\"?type=artist&a=" . urlencode($artist->artist
) . "$letter_get\" class=\"artist\">$display</a>\n";