/* Connect to the Sack Sabbath database */
$link = mysql_connect ("mysql05.iomart.com", "harrpu329", "cf3th383") or die ("Could not connect to Sack Sabbath");
mysql_select_db ("harrpu329", $link) or die ("Could not select Sack Sabbath database");
/* Look up the number of quotes available */
$sab_function_query = mysql_query("select max(QuoteNo) as No_of_quotes from songquotes",$link);
while ($row = mysql_fetch_array ($sab_function_query)) {
$No_of_quotes = $row["No_of_quotes"];
}
mysql_free_result ($sab_function_query);
/* Look up the number of quotes available */
$QuoteNo = mt_rand(1,$No_of_quotes);
$sab_function_query = mysql_query("select * from songquotes where QuoteNo = '".$QuoteNo."'",$link);
while ($row = mysql_fetch_array ($sab_function_query)) {
$SongLine = $row["SongLine"];
$Song = $row["Song"];
$Album = $row["Album"];
}
mysql_free_result ($sab_function_query);
Echo "".$SongLine."...";
/* Close Database connection */
mysql_close ($link);
?>

|