Get a free trial // Grow your CSS skills // Land your dream job

Add date (using the php date()) to the MySQL

  • # September 26, 2009 at 6:44 pm

    I have made a registration for and have got it all working I have just not managed to make the date show up properly…
    in my MySQL there is the column "dateJoined" which is formatted as DATE and this is the PHP

    $acceptHash = —
    $acceptHash .=–
    // cannot get this to show up!

    $addToDatabase = “INSERT INTO `–`.`users`
    VALUES (



    in the database it show:


    any way to get the date formatted right?

    # September 27, 2009 at 12:51 am

    what if you did this

    $date = date(“Ymd”);

    instead of this


    # September 27, 2009 at 7:36 am

    Found out how :)

    $date = date("Y-m-d");

    Thanks for your help though

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed