Search the Works List

\n"; if($keyword) { $add_keyword="AND repertoire.title like '%$keyword%'"; } if($action=="search") { if($section_on=="ON") { $add1="AND repertoire.repertoire_heading_ID='$repertoire_heading_ID2'"; } if($collection_on=="ON") { $collection2=eregi_replace(" ","-",$collection2); $add2="AND repertoire.collection LIKE '%$collection2%'"; } if($forces_on=="ON") { $add3="AND repertoire.forces LIKE '%$forces2%'"; } $result=mysql_query(" SELECT * FROM repertoire_heading, repertoire WHERE repertoire_heading.repertoire_heading_ID=repertoire.repertoire_heading_ID AND repertoire_heading.composer_ID='1' $add_keyword $add1 $add2 $add3 GROUP BY repertoire.repertoire_heading_ID ORDER BY repertoire_heading.repertoire_heading_ID "); $rows=mysql_num_rows($result); if(!$rows) { print "There are no records matching your search criteria, please try again

"; } else { print "Below are your search results

"; while(list($repertoire_heading_ID,$composer_ID,$repertoire_heading)=mysql_fetch_row($result)) { print "

$repertoire_heading

"; print ""; $works=mysql_query(" SELECT * FROM repertoire WHERE title LIKE '%$keyword%' AND repertoire_heading_ID='$repertoire_heading_ID' $add1 $add2 $add3 ORDER BY title"); while(list($repertoire_ID,$repertoire_heading_ID,$title,$forces,$collection,$comments,$autograph)=mysql_fetch_row($works)) { $title=ereg_replace("XX","'",$title); if($keyword) { $title=ereg_replace("$keyword","$keyword",$title); } $comments=eregi_replace("XX","'",$comments); if($collection_on=="ON") { $collection=ereg_replace("$collection2","$collection2",$collection); } print ""; } print "
TITLE FORCES COLLECTION ADDITIONAL
$title $forces $collection $comments
"; } } print "

Try again?

"; include("search_works_form.htm"); } else { include("search_works_form.htm"); } include("footer.inc"); ?>