#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Posts
    9
    Rep Power
    0
    I have a problem with date.
    I cannot insert a date as a value on a table.

    ie. table has 2 col: ID(int), Date(Date)

    in PHP:

    $mydate=(date("y-M-d h:i"));

    INSERT INTO Table (ID, Date) VALUES ('$ID', '$mydate')";

    why wouldn't this work?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Location
    London
    Posts
    110
    Rep Power
    0
    if you change it to a text entry you will be able to insert, or change the format as MySQL stores dates as YYYY-MM-DD

    ------------------
    cheers

Similar Threads

  1. Inserting values into Date field
    By Husky in forum MySQL Help
    Replies: 1
    Last Post: February 16th, 2004, 06:33 PM
  2. mysql date time stamp and UTF8
    By doomish in forum MySQL Help
    Replies: 0
    Last Post: February 8th, 2004, 08:37 AM
  3. insert into smallint field
    By Damien-uk in forum MySQL Help
    Replies: 3
    Last Post: February 5th, 2004, 07:39 AM
  4. 29 febr date situation
    By bogmyx5m in forum PHP Development
    Replies: 4
    Last Post: January 25th, 2004, 06:12 PM
  5. Replies: 5
    Last Post: January 22nd, 2004, 05:38 PM

IMN logo majestic logo threadwatch logo seochat tools logo