I have this sql:
SELECT
m.member_id,
m.login,
p.type
FROM
permissions p
INNER JOIN members m ON p.member_id = m.member_id
WHERE
K_id = '$kid'
ORDER BY p.type DESC
what I want to do is if p.type = 2 wrap in div id=2, and if p.type = 1 wrap in div id=1. How can this be done after a join operation?
I believe you’re after the CASE statement