{$photographer['name']}
"; if ($user->loggedin) { echo "Add this photographer to your favorites list"; } $query = mysql_query("SELECT * FROM city WHERE id = {$photographer['city']}"); if (mysql_num_rows($query) > 0) { $city = mysql_fetch_array($query); $query2 = mysql_query("SELECT name FROM country WHERE id = {$city['country']}"); $country = mysql_fetch_array($query2); } else { $city['name'] = "Not yet specified"; $country['name'] = "Not yet specified"; } echo "Lives in: " . $city['name'] . " - " . $country['name'] . "" . "Favorite genres:
"; $query = mysql_query("SELECT genre.name AS name FROM user_genre JOIN (genre) ON (user_genre.genre = genre.id) WHERE user = '{$uid}'"); while ($genre = mysql_fetch_array($query)) { echo " " . $genre['name'] . "
"; } echo "Favorite artists:
"; $query = mysql_query("SELECT artist.name AS name, artist.id AS id, country.name AS country FROM user_artist JOIN (artist, country) ON (user_artist.artist = artist.id AND artist.country = country.id) WHERE user = '{$uid}'"); while ($artist = mysql_fetch_array($query)) { echo " " . $artist['name'] . " - " . $artist['country'] . "
"; } echo "Favorite photographers:
"; $query = mysql_query("SELECT user.name AS name, user.id AS id, country.name AS country FROM user_photographer JOIN (user,city,country) ON (user_photographer.photographer = user.id AND user.city = city.id AND city.country = country.id) WHERE user_photographer.user = '{$uid}'"); while ($photographer = mysql_fetch_array($query)) { echo " " . $photographer['name'] . " - " . $photographer['country'] . "
"; } echo "