Re: [PHP] Grouping records

2008-11-04 Thread Yeti
Ok, this looks quite "databasey" so I guess you will have a query like: SELECT Rowid, Person, Timediff FROM transitional_records ORDER BY Timediff I don't know what DB you use. let's say it is MySQL (the others are similar). Always provide such things when asking for advice. Else it's not easy to

RE: [PHP] Grouping records

2008-11-04 Thread Matthew Halpin
:[EMAIL PROTECTED] Sent: Wednesday, 5 November 2008 12:28 AM To: Matthew Halpin; PHP Generals Mailing List Subject: Re: [PHP] Grouping records > I have transactional records with the following structure Records of what kind? Is it SQL? -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Grouping records

2008-11-04 Thread Yeti
> I have transactional records with the following structure Records of what kind? Is it SQL? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Grouping records

2008-11-03 Thread Matthew Halpin
Hi, I have transactional records with the following structure Rowid TimePerson TimediffGroupid 1 20:22:49Bob 2 20:22:49Bob 0 3 20:22:50Bob 1 4 2

Re: [PHP] Grouping

2006-01-19 Thread Richard Lynch
On Thu, January 19, 2006 12:19 pm, Jeffrey Pearson wrote: > OK. I know I did this a LONG time ago but I don't remember how I did > it. Thus, my post. > > I have a list of last names from a MySQL database. I need to display > them grouped by the first letter of their last names and insert a > separa

Re: [PHP] Grouping

2006-01-19 Thread Geoff
Sound like a straightforward control-break (at least, that's what they used to call it in the COBOL days :-) assuming you're getting data into an assoc array called $records, you could stick this into your loop: { $letter = $records['LastName']{0}; if ($prev != $letter) {

Re: [PHP] Grouping

2006-01-19 Thread John Nichel
Jeffrey Pearson wrote: OK. I know I did this a LONG time ago but I don't remember how I did it. Thus, my post. I have a list of last names from a MySQL database. I need to display them grouped by the first letter of their last names and insert a separator on display. Similar to a phone boo

[PHP] Grouping

2006-01-19 Thread Jeffrey Pearson
OK. I know I did this a LONG time ago but I don't remember how I did it. Thus, my post. I have a list of last names from a MySQL database. I need to display them grouped by the first letter of their last names and insert a separator on display. Similar to a phone book. So it looks like;