【发布时间】:2019-10-21 01:42:54
【问题描述】:
我正在开发内容/评论系统..
我想要:对于数组中的每个内容,最多返回 10 cmets..
我试过LIMIT 20,但这限制了总结果,如何只限制comment_id列中的重复值
$contentidArray 是内容 ID 的数组
$sthandler = $conn->prepare("SELECT * FROM comments WHERE content_id in (".$contentidArray.") order by total_reactions desc");
$sthandler->execute();
【问题讨论】:
-
所以你想添加一个
LIMIT 10? -
你面临什么问题?