include("/home2/thegaunt/www/adm/connectdb.php");
import_request_variables("gP", "");
function band_name($t_id) {
global $link;
$sql = "SELECT title FROM albums WHERE aid = '$t_id'" ;
$sql_result = mysql_query ($sql, $link ) or die ('request "Could not execute SQL query"');
$row = mysql_fetch_row( $sql_result );
return $row[0];
};
$ID = $HTTP_COOKIE_VARS["thegauntletlog"];
$sql = "SELECT * FROM mm_member_albums WHERE ID='$ID' AND aid='$aid'";
$rs_result = mysql_query($sql);
if (mysql_num_rows($rs_result)==0) {
$result = mysql_query( "INSERT INTO mm_member_albums VALUES (null, '$ID', '$aid', '$bid', CURRENT_DATE)" );
$result = mysql_query( "SELECT * FROM albums WHERE aid = $aid" );
while ( $row = mysql_fetch_object( $result ) )
{
?>
You have added " echo band_name($row->aid); ?>" to your favorite album's list.
} };
mysql_close($link);?>