点击链接可在新窗口中显示所有用户的收藏夹?

im echoing a users favourites and im limiting the results to 3 on one page in the first query. then i want it so that the user can click see all users favourites by clicking a link and be taken to a new page and then they're show all the users favourites.

im trying to do this by echoing the user's profile id into the new window, but i think i have this completely wrong can someone please show me what im doing wrong thanks.

function get_favourites() {
            global $connection;
            global $profile_id;
            $query = "SELECT e.fav_id
                        FROM ptb_user_favourites e
                        WHERE e.user_id =\"$profile_id\"
                        AND e.approved = '1'
                        LIMIT 3";
                        $favourites_set = mysql_query($query, $connection);
            confirm_query($favourites_set);
            return $favourites_set;

        }

my first page echoing out the results where the favourites are limited to 3:

<div class="prof-favourites-box2"><div class="show_more_favourites"><a href="show_all_favourites.php?to=<?php echo "$profile_id"; ?>">show all favourites ></a></div></div>
<?php
        $favourites_set = get_favourites();
        $duo_count = mysql_num_rows($favourites_set);
while ($fav = mysql_fetch_array($favourites_set)) {

    echo "<a href=\"profile.php?id={$fav['fav_id']}\"><img width=\"60px\" height=\"60px\" class=\"escort_duo_pic\" src=\"data/photos/{$fav['fav_id']}/_default.jpg\" /></a>";

show all favourites function:

function get_favourites_more() {
            global $connection;
            global $profile_id;
            $query = "SELECT e.fav_id
                        FROM ptb_user_favourites e
                        WHERE e.user_id =\"$profile_id\"
                        AND e.approved = '1'
                        LIMIT 3";
                        $get_favourites_more = mysql_query($query, $connection);
            confirm_query($get_favourites_more);
            return $get_favourites_more;

        }

my show all favourties page:

<?php
        $favourites_more_set = get_favourites_more();
        while ($fav = mysql_fetch_array($favourites_more_set)) {
            $date = age_from_dob($fav['dob']);

            echo"
            <div class=\"boxgrid caption\">
            <a href=\"profile.php?id={$fav['id']}\"><img width=140px height= 180px src=\"data/photos/{$fav['id']}/_default.jpg\"/></a>
            <div class=\"cover boxcaption\">
            <h58> {$fav['display_name']}, ".$date."</h58>
            </div>
            </div>";
        }
    ?>