How can I query a MySQL table to get the latest results from a date field?
Basically, I am inserting several records at a time at the end of each
week.
I want to have a page that displays the results for the last week only.
The date format in the field is -MM-DD
if you want the latest row
] [mailto:[EMAIL PROTECTED]
Sent: 25 June 2004 12:15
To: Tom Chubb
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Date Select
How can I query a MySQL table to get the latest results from a date field?
Basically, I am inserting several records at a time at the end of each
week.
I want
SELECT
IF( B.Booking_End_Date != -00-00,
DATE_FORMAT( B.Booking_End_Date, %Y-%m-%d ),
N/A
) AS Booking_End_Date
FROM Bookings AS B, etc.
HTH
Ignatius
_
- Original Message -
From: Shaun [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent:
try the WHERE clause.
SELECT name, address, phone, date FROM usertable WHERE date =
'-00-00'
And please, look at the mysql documentation, or at least the tutorial.
--
Marcjon
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Any one have any information on selecting a rake of dates from a mysql
database?
my current query reads.
$result = mysql_query(SELECT * FROM CWC_Memory);
I neeed to select where date is between todays date and todays date
+10.
SELECT * FROM CWC_Memory WHERE date_column BETWEEN NOW() AND