Lists from tables - arrays?
Posted: Wed Apr 27, 2011 1:31 am
Hi
I am having problems trying to view some data and wondered if anyone could help.
I have a table called 'parties' which contains fields - partyid, docid and party. There is another table called 'documents' which has fields - docid and doctitle.
I have a number of documents and for each document there are a number of parties - ie people linked to that document.
What I would like to do is get a view on screen (and also printed out) that has the title of the document followed by a list of the parties associated with that document.
For example, if in the documents table there was:
|docid |doctitle |
|1 |first document |
|2 |second document|
and in the parties table there was:
|partyid |docid |party |
|1 |1 |Fred |
|2 |1 |Jim |
|3 |1 |Jane |
|4 |2 |Peter |
|5 |2 |Fred |
I could get a view that looked like:
First document:
Fred
Jim
Jane
Second document:
Peter
Fred
I suspect it may involve arrays but I have never used them so any guidance would be very welcome.
Thanks
I am having problems trying to view some data and wondered if anyone could help.
I have a table called 'parties' which contains fields - partyid, docid and party. There is another table called 'documents' which has fields - docid and doctitle.
I have a number of documents and for each document there are a number of parties - ie people linked to that document.
What I would like to do is get a view on screen (and also printed out) that has the title of the document followed by a list of the parties associated with that document.
For example, if in the documents table there was:
|docid |doctitle |
|1 |first document |
|2 |second document|
and in the parties table there was:
|partyid |docid |party |
|1 |1 |Fred |
|2 |1 |Jim |
|3 |1 |Jane |
|4 |2 |Peter |
|5 |2 |Fred |
I could get a view that looked like:
First document:
Fred
Jim
Jane
Second document:
Peter
Fred
I suspect it may involve arrays but I have never used them so any guidance would be very welcome.
Thanks