Re: [PHP-DB] Need Help on subtract Time

2001-11-15 Thread Russ Michell

Kelvin:

If you're using MySQL - go check out: 
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
It has some great little MySQL data and time functions. I have personally found it 
invaluable.

Good luck! :-)
Russ

On Wed, 14 Nov 2001 15:49:03 -0500 kelvin [EMAIL PROTECTED] wrote:

 Hi everyone,
 
 I have a table with those field. ---Username, Uid, and Time.
 Ok, I tried to select data which their time is 2 min less from the
 current time or so.
 
 Could anyone help me out, How to do it?
 
  This is what I got, but doesn't work.
   select * from tablename where time  date(H:i:s,(time()-720));
 
  Please help!!!
 
 Thanks.
 Kelvin
 
 
 
 -- 
 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]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
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]




RE: [PHP-DB] Need Help on subtract Time

2001-11-14 Thread Rick Emery

select * from tablename where time  now() - interval 2 minute

this assumes the field time is defined as TIMESTAMP

-Original Message-
From: kelvin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Need Help on subtract Time


Hi everyone,

I have a table with those field. ---Username, Uid, and Time.
Ok, I tried to select data which their time is 2 min less from the
current time or so.

Could anyone help me out, How to do it?

 This is what I got, but doesn't work.
  select * from tablename where time  date(H:i:s,(time()-720));

 Please help!!!

Thanks.
Kelvin



-- 
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]