0
我正在嘗試製作像Facebook或Instagram這樣的故事系統。正如您在下表中看到的s_id
是唯一的帖子ID和uid_fk
帖子創建的用戶ID。將數據集顯示爲單個文章
uid_fk
=> 創建交在該表中。
和
uid_fk
=>還創建柱5。
如果查詢:
$query = mysqli_query($this->db,"SELECT s_id, uid_fk, stories_img FROM stories_posts") or die(mysqli_error($this->db));
然後HTML輸出看起來像這樣
<!--
id=s_id ,
data_uidfk=uid_fk ,
div inside imgage stories_img
-->
<div class="post" id="1" data_uidfk="4">15019557244.jpg</div>
<div class="post" id="2" data_uidfk="5">150021986050.png</div>
<div class="post" id="3" data_uidfk="4">14939786704.gif</div>
<div class="post" id="4" data_uidfk="5">14939786777.jpg</div>
<!--And other posts-->
我的問題是如何顯示的數據集作爲單篇文章這樣,
<!--
id=s_id ,
data_uidfk=uid_fk ,
div inside imgage stories_img
-->
<div class="post" data_uidfk="4">
All uid_fk = 4 posts will be show in this div.
</div>
<div class="post" data_uidfk="5">
All uid_fk = 5 posts will be show in this div.
</div>
<!--And other posts-->
預先感謝您的幫助。