Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004

    Unanswered: how to grab datetime and enter it into a form to be submitted to a MySQL Database

    I'm trying to set up a database that tracks system downtimes.
    I would like to have a date and time stamp auto insert into a form field so that it can be used as a key field, this will also serve as the incident identifier for lookup purposes. Keeping the date in the format MySQL likes is fine with me.
    I am using Dreamweaver MX 2004 and am fairly new to both DW And MySQL.
    Any help, suggestions or points in the right direction would be appreciated.
    Attached Thumbnails Attached Thumbnails web.JPG  

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    why not let the INSERT statement provide a datetime value at the moment it is entered into the database

    then you won't need a form field at all

    by the way, it is more common practice in these situations to use an auto_increment number as the identifier | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2005
    but if you realy want to add a datetime to mysql do it this way

    the string should have this format
    for example "2005-01-17 17:18:31"

    otherwise just use NOW() in the insert statement
    something like this
    INSERT INTO mytable 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