I have the tables:
users
ID | RANK | NAME | EMAIL | PASS
01 | 1 | Foo | foo@bar.com | $06$uhAMXXZowVIDQ.ZR1gky.u3f/UBkLW8Kd8cbyDt2eNx1qnZH2AUmW
allow
ID | RANK | STEP
01 | 1 | 1
02 | 1 | 2
03 | 1 | 3
04 | 2 | 1
05 | 4 | *
And, I need to know all allowed steps from user rank.
My code:
SELECT users.*, allow.step AS allow_step
FROM users AS users LEFT JOIN allow ON users.rank = allow.rank
But only one step are selected.
Thanks for help!
This should select a list of steps separated by commas. Something like
1,2,3.If you need the concatenated values to be ordered, change the first line of the query to: