AddStr($val); $db->AddStr($val); $db->AddStr($val); $where2 .= " (title like :val1) OR (artist like :val2) OR (album like :val3) "; } $where .= "AND ($where2) "; } if((isset($letter)) && (!$letter=="")) { $nextletter = chr(ord($letter)+1); if($letter=='0') $where .= " AND NOT((artist>='A') AND (artist<'ZZZZZZZZZZZ')) "; else { $db->AddStr($letter); $db->AddStr($nextletter); $where .= " AND ((artist>=:letter) AND (artist<:nextletter)) "; } } else { $letter=""; } //########## =================== ################ //Calculate total $tmp = $db->params; //Save params for second query $db->open("SELECT count(*) as cnt FROM songlist $where "); $row = $db->row(); $cnt = $row["cnt"]; //Now grab a section of that $db->params = $tmp; //Restore params $db->open("SELECT songlist.* from songlist $where ORDER BY artist ASC, title ASC ", $limit, $start); $first = $start+1; $last = min($cnt,$start+$limit); $rc = $start; $prevlnk = ""; $nextlnk = ""; if($cnt>0) { if(!isset($search)) { $search=""; } $searchstr = urlencode($search); $prev = max(0,$start-$limit); if($start>0) $prevlnk = "<< Previous"; $tmp = ($start+$limit); if($tmp<$cnt) $nextlnk = "Next >>"; } function PutSongRow($song) { global $rc, $start, $darkrow, $lightrow; $rc++; $bgcolor = $darkrow; if(($rc % 2)==0) $bgcolor = $lightrow; PrepareSong($song); ?>  

">Request this song now!
row()) PutSongRow($song); ?>
Playlist results
  ( Showing )