I don't believe anybody answered this, but here's an option:
1) Assumes table "mytable" has defined a field as: article_date date.
The following will purge anything before today.
$query = "DELETE FROM mytable WHERE article_date <
".date("Y-m-d",time());
2)
$query = "SELECT DISTINCT article_date FROM mytable ORDER BY
article_date";
$result = mysql_query($query) or die("Error message");
while( $ddrec = mysql_fetch_array($result))
{
$dd = $ddrec['article_date'];
print $dd; # you'll have to format this date
print statement
$query = "SELECT * FROM mytable WHERE article_date = $dd";
$dresult = mysql_fetch_array($query) or die("error message");
while( $irec = mysql_fetch_array($dresult) )
{
print $irec['item_text']."<BR>";
}
mysql_free_result($dresult);
}
mysql_free_result($result);
May require some additional tweaking
-----Original Message-----
From: Matt C [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 6:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] I am really stuck
I am extremely stuck with trying to do two things.
1) I would like to pull all entries out of a table that have dates that
haven't occured yet. Basically forget anything before the current day. How
do I do that?
2) I enter news into a table and would like to display a summary page.
Basically it has a list of headlines under the date they were added.
Monday 10th August
*Item 1
*Item 2
Tuesday 11th August
*Item 1
etc....
How do I do that?
Any help much appreciated,
Thanks, Matt
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]