On Sat, Jan 27, 2001 at 09:58:23AM -0600, Thomas Katsampes wrote:
> Hello,
> 
> I'm trying to figure out the correct syntax for requesting
> the database to
> remove all records older than 14 days.  The mysql query that
> I am using (from within
> php4) is:
> 
> //---update news so only last two weeks of news are
> available---//
>    $sql2 = "delete from news where newsdate <
> DATE_SUB(NOW(), INTERVAL 14 DAY)";
> $result2 = mysql_db_query($dbname,$sql);

Uh.. is this an *exact* quote of your PHP script?
Why are you defining $sql2, and using $sql in the mysql_db_query()?

G'luck,
Peter

-- 
If I had finished this sentence,

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to