qry help needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

qry help needed

Post 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 ????
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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);
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

how about

Code: Select all

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