View Single Post
Old 07-27-2004, 11:17 PM   #2 (permalink)
Rawb
Crazy
 
Location: Salt Town, UT
Joining into rows.

I would love to be able to do that, but so far, in all of my questing, nothing of the sort has ever turned up in any database server I have found.

I once tried to hack around it by using a join and joining the same table 8 times or so, naming the tables and columns different things every time. I know that some MySQL developer has my face on a dartboard for that. I quickly learned my lesson (it was cool, until it involved anything over a trivial amount of data, then it all exploded.) and reverted it to a single join, and from that single join, I looped through it in PHP and output a hash of data that my Mom could be proud of.

Sometimes, SQL won't do what you want it to, good thing we have programming languages to fall back on.

On an aside, do you think you are over-engineering this login system? Is a comma-delimited list of permissions somehow totally out of order here? Are you going to need to be able to search by permission for who has it, or are you going to just want to search for if a person has a particular permission. Although it is awful for data normalcy, and the SQL gods will strike me down for saying this, sometimes, it is far far more efficent to just throw a little delimeted list in someplace instead of going through convultions in an attempt to make everything it's own little column and row.
Rawb is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76