www.webdeveloper.com
Results 1 to 2 of 2

Thread: trouble storing date in DATE field

  1. #1
    Join Date
    Apr 2005
    Location
    Vancouver, BC
    Posts
    129

    trouble storing date in DATE field

    When I try and store a date in my DATE field as yyyy-mm-dd, it just gets added as 0000-00-00 when I view it with PHPMyAdmin. I'm not sure what i'm doing wrong

    Code:
    INSERT INTO projects (project_name,project_description,project_start_date,project_end_date,project_date) VALUES ('Sample Project','This is the sample project description','04-06-2011','04-10-2011',now());

  2. #2
    Join Date
    Apr 2005
    Location
    Vancouver, BC
    Posts
    129
    OOps - I see what I did wrong when i posted this question!

    Ok - I'll ask another question in it's place.


    How should I store dates if i want to do calculations with them? Should I store them as YYYYMMDD? Can I still maybe calculations if they're stored as: YYYY-MM-DD?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles