"; // start new table column on the right, if we have been told to display lyrics, do it // $query="SELECT * FROM Songs WHERE Current = 1 ORDER BY Title ASC"; // $rsSongs=mysql_query($query); // if we had a specific request ... if ($songRequestID <> "") { echo ""; echo "

"; // find out if a particular song lyric was requested $songRequestID = $_REQUEST['songID'] ; // find out if just current songs were requested $songsRetired = $_REQUEST['songsRetired'] ; // make database connection $connDB=mysql_connect ("localhost", "challie_bigfella", "guertin99"); if (!$connDB) { die('Could not connect: ' . mysql_error()); } // LATER - we should give the option to have parameters of current, past, cover songs // as of now, just get current rotation songs mysql_select_db ("challie_Bigfellas"); // whether or not to use retired songs depends on the $songsRetired value if ($songsRetired == "YES") { $query="SELECT * FROM Songs ORDER BY Title ASC"; } else { $query="SELECT * FROM Songs WHERE Current = 1 ORDER BY Title ASC"; } $rsSongs=mysql_query($query); $numRows=mysql_numrows($rsSongs); // DISPLAY ALL SONGS DOWN LEFT ROW echo "

"; $intCount=0; while ($intCount < $numRows) { // LATER - get the date for the show, only display if after today // get the show info from the database $songTitle=mysql_result($rsSongs,$intCount,"Title"); $songID=mysql_result($rsSongs,$intCount,"ID"); $songLyrics=mysql_result($rsSongs,$intCount,"Lyrics"); // ** Display the song title echo " " . $songTitle . "
"; $intCount++; } echo "

"; $query="SELECT * FROM Songs WHERE ID = " . $songRequestID; $rsThisSong=mysql_query($query); $strTheseLyrics=mysql_result($rsThisSong,0,"Lyrics"); // correct Lyrics string for return characters and bad ?/' substitution $strTheseLyrics = str_replace("\r", "
", $strTheseLyrics); $strTheseLyrics = str_replace("?t", "'t", $strTheseLyrics); $strTheseLyrics = str_replace("?d", "'d", $strTheseLyrics); $strTheseLyrics = str_replace("?m", "'m", $strTheseLyrics); $strTheseLyrics = str_replace("?s", "'s", $strTheseLyrics); $strTheseLyrics = str_replace("?v", "'v", $strTheseLyrics); $strTheseLyrics = str_replace("?r", "'r", $strTheseLyrics); $strTheseLyrics = str_replace("?l", "'l", $strTheseLyrics); $strThisTitle=mysql_result($rsThisSong,0,"Title"); $strInitsLyrics=mysql_result($rsThisSong,0,"WroteLyrics"); $strInitsMusic=mysql_result($rsThisSong,0,"WroteMusic"); // print the song title echo "

" . $strThisTitle . "
"; // make title the page title echo "BIGFELLAS LYRICS: " . $strThisTitle . ""; // print the songwriters $strWhoLyrics = $strInitsLyrics; $strWhoMusic = $strInitsMusic; if ($strInitsLyrics == "CR") {$strWhoLyrics = "Charlie Recksieck";} if ($strInitsLyrics == "TH") {$strWhoLyrics = "Tim Hempstead";} if ($strInitsLyrics == "TG") {$strWhoLyrics = "Tim Gadzinski";} if ($strInitsMusic == "CR") {$strWhoMusic = "Charlie Recksieck";} if ($strInitsMusic == "CC") {$strWhoMusic = "Charlie Cheney";} if ($strInitsMusic == "TH") {$strWhoMusic = "Tim Hempstead";} if ($strInitsMusic == "TG") {$strWhoMusic = "Tim Gadzinski";} echo ""; // see if Music & Lyrics should be same line if ($strWhoMusic == $strWhoLyrics) { echo "Music & Lyrics: " . $strWhoLyrics . "

"; } else { echo "Music: " . $strWhoMusic . "
"; echo "Lyrics: " . $strWhoLyrics . "

"; } // print the lyrics echo "

" . $strTheseLyrics; } else { echo "

"; echo "Click a song on the left to see the lyrics."; } echo "

"; // end PHP ?>