Actually, does the country field contains null or an empty string? If it is an empty string this will nor work. Try Control Flow Functions:

http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html

Satyam

----- Original Message ----- From: "weetat" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>; "Satyam" <[EMAIL PROTECTED]>
Cc: <php-general@lists.php.net>
Sent: Thursday, June 15, 2006 8:51 AM
Subject: Re: [PHP] mysql + PHP


hi , not working .
The empty value still sorted first.

Thanks.

Satyam wrote:
perhaps this will work:

Select country , name from tbl_chassis order by ifnull(country,'zzzz')

didn't try it.


----- Original Message ----- From: "weetat" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Thursday, June 15, 2006 8:14 AM
Subject: [PHP] mysql + PHP


Hi all,

I have SQL query , for example , Select country , name from tbl_chassis order by country.

The problem of the sql statement is that , if there are empty value in country field , it be sorted first .

How to do sorting the empty value last
? I can cp() function to do this ? or any mysql function to use?

Thanks
- weetat

--
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

Reply via email to