Not sure I understand what you are trying to do. Start by specifying an 'ORDER BY' clause in your SQL: select * from tbl_media order by status select * from tbl_media order by status desc One of those should do what you want. ________________________________ From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On Behalf Of gopi nath Sent: 08 May 2009 08:53 To: php groups Subject: Urgent my table is tbl_media (tablename) id_media,name,photo,status.(table fileds) i displayed the table. show the records.. $s = "select * from tbl_media"; $q = mysql_query($s); while($r = mysql_fetch_array){ echo $r['name']; } status value A -Active , I-Inactive i need the table fist display the status value 'A' after status value ''IA; how to fix that? for example first four records Status =A and remaining are Status=I Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox <http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox> [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]