Page 1 of 1

qry help needed

Posted: Mon Jan 31, 2005 4:47 am
by itsmani1

Code: Select all

$qryNews = "SELECT * FROM tbl_news WHERE n_show='1' order by n_date";
	$resNews = mysql_query($qryNews);
	$cntNews = mysql_num_rows($resNews);
what is hapening from the above code is:
its showing the news order by date and news posted on last date comes in the end and now i want to show news in reverce order mening news posted at the end will come at 1st.

any help ????

Posted: Mon Jan 31, 2005 5:02 am
by qads

Code: Select all

$qryNews = "SELECT * FROM tbl_news WHERE n_show='1' order by n_date DESC"; 
   $resNews = mysql_query($qryNews); 
   $cntNews = mysql_num_rows($resNews);

Posted: Mon Jan 31, 2005 5:04 am
by JayBird
how about

Code: Select all

$qryNews = "SELECT * FROM tbl_news WHERE n_show='1' order by n_date DESC";