RE: order by ASC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://www.webdeveloper.com/forum/showthread.php?t=101174

You could do it like this too...

ORDER BY `rollnumber` + 0 ASC 

And if you just got the data out in mysql (no ORDER BY -- which can be slow
in mysql), you could use PHP's sort as well...

http://php.net/manual/en/function.natsort.php

> -----Original Message-----
> From: Robert Cummings [mailto:robert@xxxxxxxxxxxxx] 
> Sent: Saturday, January 16, 2010 9:37 PM
> To: John Taylor-Johnston
> Cc: PHP-General
> Subject: Re:  order by ASC
> 
> 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 value.
> 
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux