[eluser]wiZe[/eluser]
hey there,
i got stuck with one of my SQL statements and need some help. the thing i want to achieve is the following:
there is one
groups table which stores all the basic data, which is independant from the language, and one
groups_data table which contains the language specific data of each group.
now i want to select my group from the
groups table and join it with all available languages from the
groups_data table in one statement, so i have all my groups like "laptop, pc, phone" associated with their available languages.
i would like to end up with an array like this:
Code:
Array
(
[group1_index] => Array
(
[group_id] => 1
[group_unspecific_data] => My Data
[group_languages] => Array
(
[0] => "de"
[1] => "en"
)
)
[group1_index] => Array
(
[group_id] => 2
[group_unspecific_data] => My other Data
[group_languages] => Array
(
[0] => "de"
[1] => "en"
[2] => "fr"
)
)
[group...] => ...
)
is it possible to combine several rows with a particular attribute (e.g. the group_id which reffers to the non specific group table) in a join statement? i really appreciate any hints and help, thanks in advance!
p.s.: i will use the active record pattern, but i dont even know the sql syntax for such an opertaion.
edit: i attached an image with a demo of how these tables could look like.