Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

php5 formatting date problem

  • 02-03-2006 7:42pm
    #1
    Registered Users, Registered Users 2 Posts: 742 ✭✭✭


    $sql2 = "INSERT INTO Booking_Info (Date_Booked, Start_Date, End_Date, Number_Guests, Cot_Required, Cust_Username) VALUES ('".$today."', '".$startdate."', '".$enddate."', '$number', '$cot', '".$username."')";

    hi,

    is there anyway to format startdate and enddate before they enter the database?????

    im trying to enter 03/11/2006(march 11th) as the startdate but it goes into the database as 2003/11/20

    the date is coming from my javascript popup calendar

    cheers


Comments

  • Registered Users, Registered Users 2 Posts: 927 ✭✭✭decob


    Loco wrote:
    $sql2 = "INSERT INTO Booking_Info (Date_Booked, Start_Date, End_Date, Number_Guests, Cot_Required, Cust_Username) VALUES ('".$today."', '".$startdate."', '".$enddate."', '$number', '$cot', '".$username."')";

    hi,

    is there anyway to format startdate and enddate before they enter the database?????

    im trying to enter 03/11/2006(march 11th) as the startdate but it goes into the database as 2003/11/20

    the date is coming from my javascript popup calendar

    cheers

    substr is your friend.

    substr($startdate,6,4) . "/" . substr($startdate,3,2) . "/" . substr($startdate,0,2);


  • Registered Users, Registered Users 2 Posts: 742 ✭✭✭Loco


    cheers fixed :) im sure ill have more problems soon


Advertisement