就SMF而言,我为我的部族成员编制一个名册(请不要“你要求SMF”,因为这完全不相干;这只是背景信息。
I need it to select all members (from smf_members) and order it by how many permissions they have in smf_permissions (so the script can determine who is higher in rank).
You can retrieve how many permissions there are by using: COUNT(permission) FROM smf_permissions.
我现在利用这个结构:
SELECT DISTINCT(m.id_member), m.real_name, m.date_registered
FROM smf_members AS m, smf_permissions AS p
WHERE m.id_group=p.id_group
ORDER BY COUNT(p.permission)
然而,这只是回报one row! 如何返回severalrow?
Cheers, Aart