本文整理匯總了PHP中Frontend::select_post_from_post_table_by_user_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Frontend::select_post_from_post_table_by_user_id方法的具體用法?PHP Frontend::select_post_from_post_table_by_user_id怎麽用?PHP Frontend::select_post_from_post_table_by_user_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Frontend
的用法示例。
在下文中一共展示了Frontend::select_post_from_post_table_by_user_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Frontend
<?php
require '../php_library/class_frontend.php';
$id = 1;
if (isset($_GET['id'])) {
$id = $_GET['id'];
}
$obj = new Frontend();
$posts = $obj->select_post_from_post_table_by_user_id($id);
$username = $obj->user_name_by_user_id($id);
include 'header.php';
?>
<div class="container">
<div class="row">
<div class="col-sm-8 blog-main">
<?php
if ($posts->num_rows == 0) {
echo "<h2>No post found by this Author";
} else {
echo "<h1>Showing posts written by {$username} </h1> <hr><br>";
}
while ($post = $posts->fetch_assoc()) {
?>
<div class="blog-post">
<h2 class="blog-post-title">
<a href= "post.php?id=<?php
echo $post['id'];
?>
"><?php
echo $post['title'];