表行SQL中的WordPress计数值

时间:2017-11-01 03:08:33

标签: php mysql wordpress

我有一个WordPress数据表作为图像。我的用户评分是(最多5 *)。

enter image description here

(在我的数据中,我有2个等级5 *对于postid = 1/1等级4 *对于postid = 1)。如何为postid = 1(是2)回显数字等级5 *?类似于评级4 * / 3 * ... 1 *。

有什么想法吗?感谢。

1 个答案:

答案 0 :(得分:1)

您的SQL语句可以是"SELECT count(id) FROM table WHERE postid = 1 AND rating = 5"