我想从我的表中按日期排序选择注解,并将按父注解关联为wordpress注解。
这是我的table:
+-----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| comment_by | int(11) | YES | | NULL | |
| post | int(11) | YES | | NULL | |
| comment | varchar(255) | YES | | NULL | |
| comment_parents | int(11) | YES | | NULL | |
| date | datetime | YES | | NULL | |
+-----------------+--------------+------+-----+---------+----------------+
我想这样显示:视图
.row{
display:flex;
}
ul li{
list-style:none;
padding-left:15px;
}
a{
text-decoration:underline;
color:blue;
}
ul{margin:0px;}
.cmt{font-size:20px;}
<div>
<div class="cmt"><a>Jonh</a> : I like this post.</div>
<ul>Replay:
<li><a>Admin</a> : Thanks</li>
<li><a>Lina</a> : I like this post too.</li>
<li><a>Admin</a> : Thanks.</li>
</ul>
<div class="cmt"><a>Mr Jenny</a> : Wow great!</div>
<ul>Replay:
<li><a>Admin</a> : Thanks</li>
</ul>
<div class="cmt"><a>Mr Toto</a> : Thanks for this post!</div>
</div>
我想选择注解:父注解是orderbydatedesc,回复注解也是orderbydatedesc。我尝试选择:
SELECT * FROM comments WHERE post = 1 GROUP BY comment_parents ORDER BY date DESC
但结果是没有选择父母。
暂无答案!
目前还没有任何答案,快来回答吧!