Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: php date time

  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    php date time

    Im not quite sure on how to display or process this for my site but im realy in need of it......

    My problem lies here:

    What i want to do is have the user input there own dates and times for their event. I will then process the dates/times and enter into mysql...but this is where im confused.......

    Here is an image of the form fields how i want it to look it:

    http://i16.photobucket.com/albums/b1...rmdatetime.jpg

    how do i process these using php, and how do i insert it into mysql for future use... how do i select them from mysql when its the current date...

    thanks for reading, hope you can help me........

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Try using the TIMESTAMP field type in your database:

    http://dev.mysql.com/doc/refman/5.0/en/timestamp.html

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    I recommend you get a book on PHP/MySQL. This would be a good protect for a first time coder. The date time form would be a pull down select menu generated from a php array of days, months and time. Results then POSTed into the MySQL database, very easy to do this.

    Good book is PHP and MySQL For Dynamic Websites by Larry Ullman, which has an example of the pull down menu you need.
    Leonard Whistler


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •