The query is 

select * from newsa ORDER BY id DESC LIMIT 0,3

look at the query above carefully.

Charlie Markwick <[EMAIL PROTECTED]> wrote:                             
-----Original Message-----
 From: php_mysql@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tedit 
kap
 Sent: 04 May 2008 01:42
 To: php_mysql@yahoogroups.com
 Subject: [php_mysql] DESC in mysql results
 
 Hi all,
  
  
 $query=mysql_query("select * from newsa ORDER BY id DESC LIMIT 3");
  
 while ($row = mysql_fetch_array($query)) { echo"..............
  
 if we say the id of rows goes from 1 to 100, so the last row's id is 100,
  
 this code displays the results for the ids as follows:
  
 row with id 98
 row with id 99
 row with id 100
  
 The question is, I want it to display as :
  
 row with id 100
 row with id 99
 row with id 98
  
 How can I achieve this?
  
 (if i try ASC instead of DESC it displays rows with ids 1,2,3 - that is not 
what I want)
 
 __________________________________________________________
 Be a better friend, newshound, and
 know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
 
 [Non-text portions of this message have been removed]
 
 ------------------------------------
 
 The php_mysql group is dedicated to learn more about the PHP/MySQL web 
database possibilities through group learning. Yahoo! Groups Links
 
 
     
                                       




       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply via email to