cycle through records and add to array

brucesilvers

Registered User.
Local time
Yesterday, 16:28
Joined
Aug 4, 2000
Messages
70
I am attempting to create an index of items in a table. The data looks something like this:
Bob...2
Jerry...27
Bob...79
Phil...14
Jerry...53
Bob 102
etc.

I would like to create output like this:
Bob...2, 79, 102
Jerry...27, 53
Phil...14
etc.

Is it possible to cycle through the records and dump items into an array such as:
(Bob;2, 79, 102)
(Jerry; 27, 53)
etc.

OR - am I making this more difficult than it needs to be and is there an easier way to accomplish that?
 
brucesilvers said:
OR - am I making this more difficult than it needs to be and is there an easier way to accomplish that?
It certainly looks like you are making something more complicated than it need be but, given such limited information, it's even more difficult to say what you are making complicated.
 
why you don´t use a table(name,number) and get the output with a query?
 
More info

I have a table of quotations by various authors, with the following structure:

quote_id (integer, primary key)
author (text)
quote (memo)

Some of the authors appear only once, some of the authors appear a number of times.

I would like to output an index of quote_id's by author in the format:

author: quote_id, quote_id, quote_id

Sample Output:

Barrymore: 96
Cervantes: 116, 121, 126
Shakespeare: 15, 27, 138, 249
etc.
 
Bruce,

What is it you plan on doing with the output after you have it? There might be a different (possibly better) method of doing it to give you the results.
 
In the end, I'd like to create print-ready output to be included in the appendix of a book.

However, any output that groups author with however many entries (quote_id's) in the format I mentioned above is fine - a query, a report, unformatted text output, etc.
 

Users who are viewing this thread

Back
Top Bottom