Re: [PHP-DB] datetime insert using now()

2001-12-11 Thread bill

Aha.  That seems to work.

thanks,

bill

Charles Lahlou wrote:

> >INSERT INTO thisdb (event) VALUES ((now() + 3600);
>
> try rather VALUES (now() + INTERVAL 3600 SECOND)
>
> charles lahlou
>
> --
> 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]




RE: [PHP-DB] datetime insert using now()

2001-12-11 Thread Charles Lahlou


BTW, 

IN SQL ANSI, these functions are standard too? Don't they?

 - ADDDATE(date1, INTERVAL value UNIT)
   with UNIT = SECOND, HOUR_SECOND, DAY, and so on...
 - MOD(value, modulo) 
   and its shortcut value%modulo
 - Arithmetic operators such as && + ||
 - Is it Better to use <> or !=
 - Is there a recognized format for 

At least, are they standard in other SQL languages such as
oracle, access, postgres, msSql, mSql, etc..

HAS ANSI SQL any validity over SQL languages?
How to consult it (ANSI doesn't deliver the document for free) ?

Question extensible to:
Where to get SQL language comparison charts on their compatibility?

Charles Lahlou
-Message d'origine-
De : bill [mailto:[EMAIL PROTECTED]]
Envoye : mardi 11 decembre 2001 16:48
A : [EMAIL PROTECTED]
Objet : [PHP-DB] datetime insert using now()


I'm trying to insert information into a datetime field in a MySQL
database with the following:

INSERT INTO thisdb (event) VALUES ((now() + 3600);

But it only works sometimes.  Why sometimes?  What would be a better way
of doing it?




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




RE: [PHP-DB] datetime insert using now()

2001-12-11 Thread Charles Lahlou


>INSERT INTO thisdb (event) VALUES ((now() + 3600);

try rather VALUES (now() + INTERVAL 3600 SECOND)


charles lahlou


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




Re: [PHP-DB] datetime insert using now()

2001-12-11 Thread Dobromir Velev

Hi
Could you be more specific about the thing that it works only sometimes - when doesn't 
it work and what happens then.
You can check and try the date_add() function but probably the problem is in your 
query. 

Dobromir Velev
Web Developer
http://www.websitepulse.com/
 

-Original Message-
From: bill <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, December 11, 2001 18:08
Subject: [PHP-DB] datetime insert using now()


>I'm trying to insert information into a datetime field in a MySQL
>database with the following:
>
>INSERT INTO thisdb (event) VALUES ((now() + 3600);
>
>But it only works sometimes.  Why sometimes?  What would be a better way
>of doing it?
>
>
>
>
>-- 
>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]