I have 3 tables: a list of articles, a list of authors, and a table joining the two via the article and author IDs. The join table looks like this:
art_id auth_id ord
1 1 1
2 1 1
2 4 2
So author 1 contributed to both articles 1 and 2. The "ord" field is the order in which the author appears in the citation.
I am trying to write an index page that will list each title and then the authors who contributed. When I select all the data from my database at once, I will get information for 42 articles, but there will be more than 42 rows, because some articles have as many as 4 authors.
Is there a way for me to use PHP to put this data into a multidimensional array where each title (or article id) would be a key index for each row which would then contain an array of the authors associated with that article?
Please ask for further explanation, if required. Thanks in advance!