www.webdeveloper.com
Results 1 to 2 of 2

Thread: Insert date into database

  1. #1
    Join Date
    Apr 2010
    Location
    Athens, Greece
    Posts
    32

    Insert date into database

    I can't seem to understand how to store date into mysql table.
    I use data type:date into this field of the table.
    First of all I want to store today's date.
    In my PHP I create a var $date = date("Y-n-j"); I store this var and I get 0000-00-00. I also tried with now() inside my query but still get the same result.

    Can anyone explain to me the way we store dates?

  2. #2
    Join Date
    Apr 2010
    Location
    Athens, Greece
    Posts
    32
    Ok. I realized I was making a terrible mistake somewhere else in my code.
    The variable works fine.
    Sorry if I spent your time with this.

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