Re: [PHP-DB] delete time related data inside a table within 1 hour

2004-10-26 Thread Mark-Walter
Hi Martin,

> http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html says
> that's the right format.  Are you sure you're storing the time and not
> just the date?  I'd wager that it will delete immediately if you are
> only storing the date.

I agree as it is the right format but when I use INTERVAL 1 HOUR it 
deletes it immediately.

The used column is date and time related 2004-10-24 07:42:34 and
work's fine while using INTERVAL -1 DAY.

-- 
Best Regards,

Mark

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] delete time related data inside a table within 1 hour

2004-10-25 Thread Norland, Martin
http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html says
that's the right format.  Are you sure you're storing the time and not
just the date?  I'd wager that it will delete immediately if you are
only storing the date.


- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 25, 2004 3:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] delete time related data inside a table within 1 hour


Hello,

to delete old entries within 1 one day I use this:

$sql = ("DELETE FROM orders WHERE time_date < DATE_ADD(NOW(), INTERVAL
-1 DAY)");

Now I would like to delete within a timeframe of 1 hour.

But when I change the above statement to 1 hour or -1 hour it deletes 
immediately.

Maybe someone could help me at this point.

-- 
Best Regards,

Mark

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] delete time related data inside a table within 1 hour

2004-10-25 Thread Mark-Walter
Hello,

to delete old entries within 1 one day I use this:

$sql = ("DELETE FROM orders WHERE time_date < DATE_ADD(NOW(), INTERVAL
-1 DAY)");

Now I would like to delete within a timeframe of 1 hour.

But when I change the above statement to 1 hour or -1 hour it deletes 
immediately.

Maybe someone could help me at this point.

-- 
Best Regards,

Mark

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php