Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Retrieving data from database on latest and featured products div.
Posted
Comments
Sascha Lefèvre 3-Apr-15 2:42am    
Please read: http://www.codeproject.com/Articles/64628/Code-Project-Quick-Answers-FAQ#rules
Mohibur Rashid 3-Apr-15 4:44am    
There is more than one way.

1 solution

this query returns latest records that recently added.

SQL
$sql = "
     SELECT column_name1,column_name2,...
     FROM table_name
     WHERE column_name = value
     ORDER BY ID DESC "
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900