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

时间:2013-02-13 00:16:36

标签: php mysql

即时回显用户收藏夹,并在第一个查询中将结果限制为3在一页上。然后我想要它,以便用户可以通过单击链接点击查看所有用户收藏夹并转到新页面,然后他们显示所有用户的收藏夹。

我试图通过将用户的个人资料ID回显到新窗口来做到这一点,但我想我有这个完全错误,有人请告诉我我做错了谢谢。

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;

        }

我的第一页回显了收藏夹限制为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>";

显示所有收藏夹功能:

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;

        }

我的所有优惠页面:

<?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>";
        }
    ?>

0 个答案:

没有答案