Re: [PHP] sorting troubles

2006-04-25 Thread William Stokes
Thanks for your input everyone! The easiest way to do this was ansding this to the SELECT clause: select col from DB order by substring(col, 1, 1) ASC, substring(col, 2) DESC Seems to work fine. -Will ""Richard Lynch"" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > On Sat, April 2

Re: [PHP] sorting troubles

2006-04-25 Thread Richard Lynch
On Sat, April 22, 2006 4:49 am, William Stokes wrote: > I have a column in DB that contains this kind of data, > A20,B16,B17C14,C15,D13,D12 etc. > > I would like to print this data to a page and sort it ascending by the > letter an descending by the number. Can this be done? Like > > A20 > B17 > B1

Re: [PHP] sorting troubles

2006-04-24 Thread Philip Thompson
On Apr 24, 2006, at 9:06 AM, Philip Thompson wrote: On Apr 22, 2006, at 4:49 AM, William Stokes wrote: Hello, Any idea how to sort this? I have a column in DB that contains this kind of data, A20,B16,B17C14,C15,D13,D12 etc. I would like to print this data to a page and sort it ascending by

Re: [PHP] sorting troubles

2006-04-24 Thread Philip Thompson
On Apr 22, 2006, at 4:49 AM, William Stokes wrote: Hello, Any idea how to sort this? I have a column in DB that contains this kind of data, A20,B16,B17C14,C15,D13,D12 etc. I would like to print this data to a page and sort it ascending by the letter an descending by the number. Can this be do

Re: [PHP] sorting troubles

2006-04-23 Thread David Tulloh
William Stokes wrote: > Hello, > > Any idea how to sort this? > > I have a column in DB that contains this kind of data, > A20,B16,B17C14,C15,D13,D12 etc. > > I would like to print this data to a page and sort it ascending by the > letter an descending by the number. Can this be done? PHP ha

Re: [PHP] sorting troubles

2006-04-23 Thread chris smith
> I have a column in DB that contains this kind of data, > A20,B16,B17C14,C15,D13,D12 etc. > > I would like to print this data to a page and sort it ascending by the > letter an descending by the number. Can this be done? Like > > A20 > B17 > B16 > C15 > C14 > D13 > D12 Depending on how many recor

Re: [PHP] sorting troubles

2006-04-22 Thread Paul Novitski
At 03:43 AM 4/22/2006, I wrote: Then just do a reverse sort on $aTemp and you get: Z20 Y17 Y16 Then translate the letters back to their original values and you get: A20 B17 C16 Oops, I made a typo: that final value should have been B16, not C1

Re: [PHP] sorting troubles

2006-04-22 Thread Paul Novitski
At 02:49 AM 4/22/2006, William Stokes wrote: I have a column in DB that contains this kind of data, A20,B16,B17C14,C15,D13,D12 etc. I would like to print this data to a page and sort it ascending by the letter an descending by the number. Can this be done? Like A20 B17 B16 C15 C14 D13 D12 Wi

Re: [PHP] sorting troubles

2006-04-22 Thread Peter Hoskin
hmm, should also see http://www.php.net/sort Peter Hoskin wrote: > See explode, http://www.php.net/explode > > $var = 'A20,B16,B17C14,C15,D13,D12'; > $array = explode(',',$var); > > foreach ($array as $key => $value) { > echo $value ."\n"; > } > > > William Stokes wrote: > >> Hello, >> >> Any

Re: [PHP] sorting troubles

2006-04-22 Thread Peter Hoskin
See explode, http://www.php.net/explode $var = 'A20,B16,B17C14,C15,D13,D12'; $array = explode(',',$var); foreach ($array as $key => $value) { echo $value ."\n"; } William Stokes wrote: > Hello, > > Any idea how to sort this? > > I have a column in DB that contains this kind of data, > A20,B1