Results 1 to 4 of 4

Thread: Help

  1. #1
    Join Date
    Aug 2003
    Posts
    328

    Unanswered: 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 16:04.

  2. #2
    Join Date
    Mar 2004
    Posts
    8

    Re: Help

    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

  3. #3
    Join Date
    Aug 2003
    Posts
    328

    Re: Help

    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.

  4. #4
    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());

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •