If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-15-04, 13:39
exdter exdter is offline
Registered User
 
Join Date: Aug 2003
Posts: 328
Help

I need to set a date field in a MySQL table to timestamp. For some reason the date keeps showing up as 0000-00-00. I am uploading data to a MySQL database from a web application and I want the date to be put in automatically when the user submits the info. I have narrowed it down to if the field is set to not null then I get no records returned. If I set the field to nullable then I get the records, but the date does not go in automatically. Can someone help?
Thanks

Last edited by exdter; 03-15-04 at 15:04.
Reply With Quote
  #2 (permalink)  
Old 03-16-04, 01:55
pekron pekron is offline
Registered User
 
Join Date: Mar 2004
Posts: 8
Re: Help

Quote:
Originally posted by exdter
I need to set a date field in a MySQL table to timestamp. For some reason the date keeps showing up as 0000-00-00. I am uploading data to a MySQL database from a web application and I want the date to be put in automatically when the user submits the info. I have narrowed it down to if the field is set to not null then I get no records returned. If I set the field to nullable then I get the records, but the date does not go in automatically. Can someone help?
Thanks
The date-field is not automatically filled, you will need to enter NOW() when inserting the post.

/pekron
Reply With Quote
  #3 (permalink)  
Old 03-16-04, 10:33
exdter exdter is offline
Registered User
 
Join Date: Aug 2003
Posts: 328
Re: Help

Quote:
Originally posted by pekron
The date-field is not automatically filled, you will need to enter NOW() when inserting the post.

/pekron
Thanks for your reply. I know I need to enter now when inserting the post, but I am using Dreamweaver and can find no help on how to write a query in that application. Thanks.
Reply With Quote
  #4 (permalink)  
Old 03-17-04, 02:06
trieder trieder is offline
Registered User
 
Join Date: Sep 2003
Posts: 69
When you write the insert you place NOW() in the spot where you insert the date... ie:

INSERT INTO THE_TABLE(thedate) VALUES (NOW());
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On