Re: [PHP] Best way to sort?

2004-06-06 Thread Burhan Khalid
Brian Dunning wrote: I'm not sure if this is a complex SQL query or a PHP array sorting thing, but what's the best way to take this data: Tom Greg Brian Tom Brian Tom And return the following results, sorted by number of records: Tom - 3 Brian - 2 Greg - 1 Any thoughts? I'm not

RE: [PHP] Best way to sort?

2004-06-04 Thread Angelo Zanetti
what is the 2? in the order by statement mean? thanks -Original Message- From: Raúl Castro [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 6:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Best way to sort? The best way is: SELECT person_name, count(*) FROM table_name GROUP

RE: [PHP] Best way to sort?

2004-06-04 Thread Daniel Clark
Order by the 2nd column what is the 2? in the order by statement mean? thanks -Original Message- From: Raúl Castro [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 6:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Best way to sort? The best way is: SELECT person_name, count

Re: [PHP] Best way to sort?

2004-06-04 Thread Raúl Castro
: Friday, June 04, 2004 2:20 AM Subject: RE: [PHP] Best way to sort? what is the 2? in the order by statement mean? thanks -Original Message- From: Raúl Castro [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 6:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Best way to sort

[PHP] Best way to sort?

2004-06-03 Thread Brian Dunning
I'm not sure if this is a complex SQL query or a PHP array sorting thing, but what's the best way to take this data: Tom Greg Brian Tom Brian Tom And return the following results, sorted by number of records: Tom - 3 Brian - 2 Greg - 1 Any thoughts? -- PHP General Mailing List

Re: [PHP] Best way to sort?

2004-06-03 Thread John Nichel
Brian Dunning wrote: I'm not sure if this is a complex SQL query or a PHP array sorting thing, but what's the best way to take this data: Tom Greg Brian Tom Brian Tom And return the following results, sorted by number of records: Tom - 3 Brian - 2 Greg - 1 Any thoughts? MySQL's

RE: [PHP] Best way to sort?

2004-06-03 Thread Angelo Zanetti
select thename, count(thename) from tablename order by thename asc group by thename Try this -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Thursday, June 03, 2004 3:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Best way to sort? I'm not sure if this is a complex

Re: [PHP] Best way to sort?

2004-06-03 Thread Rob Adams
Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] select thename, count(thename) from tablename order by thename asc group by thename or... to sort by number of records select name, count(name) as ncnt from table group by name order by ncnt desc -- Rob -- PHP

Re: [PHP] Best way to sort?

2004-06-03 Thread Daniel Clark
SELECT DISTINCT person_name, count(*) FROM table_name GROUP BY person_name ORDER BY 2 DESC I'm not sure if this is a complex SQL query or a PHP array sorting thing, but what's the best way to take this data: Tom Greg Brian Tom Brian Tom And return the following

Re: [PHP] Best way to sort?

2004-06-03 Thread Raúl Castro
The best way is: SELECT person_name, count(*) FROM table_name GROUP BY person_name ORDER BY 2 DESC - Original Message - From: Daniel Clark [EMAIL PROTECTED] To: Brian Dunning [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, June 03, 2004 10:30 AM Subject: Re: [PHP] Best way

[PHP] Best way to sort a multidimentional array....

2003-02-19 Thread Mark Cubitt
Hello, I need to manipulate, the following data in a number of diffierent ways (specifics follow). Telephone extension number - 4 digits in the range 2000-2119 Total time on phone - seconds integer values Total No. of calls - integer value Name - A persons name I'm purposely NOT using a

RE: [PHP] Best way to sort a multidimentional array....

2003-02-19 Thread Ford, Mike [LSS]
-Original Message- From: Mark Cubitt [mailto:[EMAIL PROTECTED]] Sent: 19 February 2003 12:43 I need to manipulate, the following data in a number of diffierent ways I'm storing the data in a multidemensional array, the stucture of which is below, and I need to sort it by