Search code examples
phpmysqlsenddatebox

How To Enter DateBox Data Into Database PHP


When a date is entered using datebox, it is sent to the php file as: date=2013-06-17 In the php, how should I enter this in a database easily so i can compare dates later?

Time is sent as time=14%3A24 (the same as 14:34 in 24-hour clock). In php how can i enter the time into database? I was thinking about doing it by time after midnight, but how can i convert this (because there is a colon).


Solution

  • Use this:

    http://php.net/manual/en/function.date.php

    Store it as a variable and enter it into the database.