David,
My system (3.23.40-nt and MySQL-Front 1.18b as client) produces (what I think is) the
desired result using
both/either the NULL or NOW() alternatives - NOW (without function parentheses) is not
recognised.
However the INSERT statement below does not work without the addition of the VALUES
keyword:
6.4.3 INSERT Syntax
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES (expression,...),(...),...
Hope you feel better for your sleep...
Regards,
=dn
> My response below is incorrect, with regard to the NULL behavior. MySQL
> will insert the current time and date for a TIMESTAMP only for the first
> column *if* you omit the columns from the INSERT statement. If you set
> the column to NULL explicitly, MySQL should set any TIMESTAMP to the current
> date and time. Dunno why that doesn't work for David, it works for me.
>
> Thanks to BD for pointing out my brain-lapse. :-)
>
>
> >>I have created a test table with:
> >>
> >>CREATE TABLE TimeTest (
> >>Time1 TIMESTAMP(4),
> >>Time2 TIMESTAMP(8),
> >>Time3 TIMESTAMP(10),
> >>Time4 TIMESTAMP(12),
> >>Time5 TIMESTAMP(14));
> >>
> >>This works fine! No problemo
> >>
> >>Now ALL I am trying to do is insert the current time and date into each
> >>field in the table!! That's all.
> >>I'm not new to MySQL or its operation but this has really got the better
> >>of me. Maybe its because its 11:40PM after a day of work but can
> >>someone please tell me how I can insert a row of current time and date
> >>into a table with different column definitions!
> >>
> >>I have tried:
> >>INSERT INTO TimeTest (NULL, NULL, NULL, NULL, NULL);
> >>
> >>I have tried NOW, 'NULL'.
> >
> >NOW() would work better than NOW.
> >
> >NULL will insert the current date and time only into the *first*
> >TIMESTAMP column.
> >
> >http://www.mysql.com/doc/D/A/DATETIME.html
> >
> >>
> >>Please
> >>
> >>
> >>Thanks
> >>DA
---------------------------------------------------------------------
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