Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Help with inserting Date into MySQL DB from registration form input

New Here ,
May 19, 2009 May 19, 2009

Copy link to clipboard

Copied

I'm trying to automatically input the registration date of a customer into my MySQL DB. Nothing seems to work. I've tried timestamp in a table field, I've tried a hidden field in the form. Any suggestions?

TOPICS
Server side applications

Views

684
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2009 May 19, 2009

Copy link to clipboard

Copied

When defining your table in MySQL, use a TIMESTAMP column. MySQL stores all dates, including timestamps in the format YYYY-MM-DD HH:MM:SS. If you are trying to insert the date in any other format, MySQL won't accept it, and converts it to 0000-00-00 00:00:00

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 21, 2009 May 21, 2009

Copy link to clipboard

Copied

LATEST

You can use NOW() in the insertion record code, it will display like a time stamp format (date + time). Otherwise u can use this if u just want to store the date, $today = date("j F Y "); . It will display like 21 May 2009. Further information about date() function you can get it HERE.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines