Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Add date (using the php date()) to the MySQL

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26257
    bor003
    Member

    Hi,
    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

    Code:
    $acceptHash = —
    $acceptHash .=–
    // cannot get this to show up!
    $date=date(“Ymd”);

    $addToDatabase = “INSERT INTO `–`.`users`
    (—-`dateJoined`)
    VALUES (
    —-
    ‘$date’

    );”;

    mysql_query($addToDatabase);

    in the database it show:

    [img]http://grab.by/6da[/img]

    any way to get the date formatted right?

    #64736
    cybershot
    Participant

    what if you did this

    $date = date(“Ymd”);

    instead of this

    $date=date(“Ymd”);

    #64750
    bor003
    Member

    Found out how :)

    Using:
    $date = date("Y-m-d");
    now.

    Thanks for your help though

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.