php mysql issue

Discussion in 'MySQL' started by protocol96, May 30, 2007.

  1. #1
    i had a date in the format dd/mm/yyyy now i exploded this by "/" and got 3 array holding these values, after which i concatenated them in order and assigned it to a variable,

    now as I insert the value into variable type DATE, it doesnt go in, but i insert it into a varchar, it gets inserted.

    Help please??
     
    protocol96, May 30, 2007 IP
  2. Clark Kent

    Clark Kent Guest

    Messages:
    122
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you want to use date variable, try formatting in query like this:

    date("Y-m-d H:i:s", strtotime($your_date))
     
    Clark Kent, May 30, 2007 IP
  3. carolynheath

    carolynheath Peon

    Messages:
    680
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes, CK got it
    beating around the bush like that will change it to a regular type
     
    carolynheath, May 30, 2007 IP