Example #1
0
    if ($PageDisplay < 0) {
        $PageDisplay = 0;
    }
}
//Jia Edit
$conn = getconn();
$stmt = $conn->prepare("select * from user_fav as F WHERE F.email = '" . $myemail . "' order by F.postid;");
$result2 = $stmt->execute();
if (!$result2) {
    echo "What the f**k?";
    pdo_die($stmt);
}
$result2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
//End of Edit
//Modified
Print_Fav_Post($result, $myemail, $PageDisplay, $result2);
//Print_Post($result,$myemail,$PageDisplay);
if ($max_page > 0) {
    echo '<ul class="pagination">';
    for ($i = 0; $i <= $max_page; $i++) {
        if ($i == $PageDisplay) {
            echo '<li class = "active">';
        } else {
            echo '<li>';
        }
        echo '<a href="admin.php?page=' . $i . '">' . ($i * $numPerPage + 1) . '-' . ($i + 1) * $numPerPage . '</a>';
    }
    echo '</ul>';
}
echo '</div>';
include_once "footer.php";
Example #2
0
function Display_all_query($myemail)
{
    $conn = getconn();
    $stmt = $conn->prepare("select * from post_info P, user_fav F WHERE P.postid = F.postid and F.email = '" . $myemail . "' order by time DESC;");
    $result = $stmt->execute();
    if (!$result) {
        echo "What the f**k?";
        pdo_die($stmt);
    }
    $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
    $conn = getconn();
    $stmt = $conn->prepare("select * from user_fav as F WHERE F.email = '" . $myemail . "' order by F.postid;");
    $result2 = $stmt->execute();
    if (!$result2) {
        echo "What the f**k?";
        pdo_die($stmt);
    }
    $result2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
    Print_Fav_Post($result, $myemail, 0, $result2);
}