Hi Guys!
I have the same tables as in this question: http://stackoverflow.com/questions/1202978/mysql-query-over-many-to-many-relationship. What I'm struggling with, though, is how to construct a query which would obtain a plant with all its attributes. I.e. if I want P1 I get
P1 | A1 | A2 | A3 or P1 | A1, A2, A3
As opposed to
P1 | A1
P1 | A2
P1 | A3
if I want all plants, I get
P1 | A1 | A2 | A3 P1 | A1, A2, A3
P2 | A1 | A2 or P2 | A1, A2
P3 | A2 | A3 P3 | A2, A3
And the other way round as well, that is display all plants for a given parameter. First of all - is it possible to create such an SQL query?
What I have at the moment is I obtain each plant once and for each row I access the database again asking for attributes. As you probably realise it's very inefficient so I hope you can point me in the right direction.
EDIT: I'd like to get one plant per one row and all the attributes in that same row.