RE: [PHP] order by ASC

2010-01-19 Thread Ashley Sheridan
; 1001 > >>> 998 > >>> 999 > >>> > >>> I want it to order like this: > >>> > >>> 998 > >>> 999 > >>> 1000 > >>> 1001 > > > _ > > From: Ashley Sheridan [mailto:a..

RE: [PHP] order by ASC

2010-01-19 Thread Daevid Vincent
gt;>> 999 >>> 1000 >>> 1001 _ From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Tuesday, January 19, 2010 4:40 PM To: Daevid Vincent Cc: 'PHP-General' Subject: RE: [PHP] order by ASC On Tue, 2010-01-19 at 16:16 -0800, Daevid Vincent wrote:

RE: [PHP] order by ASC

2010-01-19 Thread Ashley Sheridan
gt; in mysql), you could use PHP's sort as well... > > http://php.net/manual/en/function.natsort.php > > > -Original Message- > > From: Robert Cummings [mailto:rob...@interjinn.com] > > Sent: Saturday, January 16, 2010 9:37 PM > > To: John Taylor-Jo

RE: [PHP] order by ASC

2010-01-19 Thread Daevid Vincent
t.php > -Original Message- > From: Robert Cummings [mailto:rob...@interjinn.com] > Sent: Saturday, January 16, 2010 9:37 PM > To: John Taylor-Johnston > Cc: PHP-General > Subject: Re: [PHP] order by ASC > > John Taylor-Johnston wrote: > > Did some googl

Re: [PHP] order by ASC

2010-01-16 Thread Robert Cummings
John Taylor-Johnston wrote: Did some googling. This worked: ORDER BY CAST(`rollnumber` AS SIGNED) What is the difference? My problem in the meanwhile must be my version of MySQL? You could have skipped quotes altogether. The difference is that you are referencing a field name, not a string v

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
Did some googling. This worked: ORDER BY CAST(`rollnumber` AS SIGNED) What is the difference? My problem in the meanwhile must be my version of MySQL? John Taylor-Johnston wrote: It hates me: SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(rollnumber

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
It hates me: SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(rollnumber AS int) SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(`rollnumber` AS int) SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life

Re: [PHP] order by ASC

2010-01-16 Thread Robert Cummings
John Taylor-Johnston wrote: Ok, I think this is a MySQl question. Take pity on me? $sql = "SELECT * FROM $db.`mailinglist` WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY `rollnumber` ASC"; rollnumber is a varchar(50). I need it to be a text field. ASC does not order the way