  <?php
    //connect to batabase
    define('IN_BANDTOPIA', "You're here!!!");
    require_once('config.php');
    try {
 	 $mydb = mysql_connect($db_server, $db_username, $db_password);
	 $bt_dbconn = mysql_select_db($db_name, $mydb);
    } catch (Exception $e) {
	 die("Could not connect to database<br>" . $e);
    }
    
    //vars for adding a favorite band
    $usID=$_GET['uID'];
	$arID=$_GET['aID'];	
	
	//form button for adding a favorite band
	print('<form method="post" action="bandpublic.php">');
	print('<input type="submit" value="Add Band" />');
	print('</form>');
	
	//form processing for adding a favrite band
	if($_SERVER['REQUEST_METHOD'] == 'POST') {
     $r = mysql_query("INSERT INTO FavArtists(UserId,ArtistId,StreetTeam) VALUES('$usID','$arID',0)") or die(mysql_error()); 
	}

  ?>	

