Order by question
Posted: Fri Jun 09, 2006 5:46 pm
Hi,
I have a page http://www.jlp.ie/future_events.php and when the page loads the information on the right-hand side is taken from the first entry in the database where I want it to be the last or latest entry in the database. Normally I know this is done by adding Order by ASC/DESC etc but as the information on the right is queried by the links on the left of the page by the following.
So my problem is that I can’t add WHERE id = %s ORDER by ASC as this obviously doesn’t work so can anyone advise me as to how I can get the page to initially load with the details on the right showing the most recent information that is added to the database.
Thank you very much
Brian
I have a page http://www.jlp.ie/future_events.php and when the page loads the information on the right-hand side is taken from the first entry in the database where I want it to be the last or latest entry in the database. Normally I know this is done by adding Order by ASC/DESC etc but as the information on the right is queried by the links on the left of the page by the following.
Code: Select all
$query_GetNewsDetails = sprintf("SELECT * FROM future_events WHERE id = %s ", $colname_GetNewsDetails);Thank you very much
Brian