Jump to content

Date select box


camdenite

Recommended Posts

Hi,

    I'm trying to create a date select box that will post to a table 'date2' but I am not sure how to create the php. I have done this:

 

if(isset($_POST['submit']))

{

$month=$_POST['month'];

$dt=$_POST['dt'];

$year=$_POST['year'];

$date2="$month/$dt/$year";

 

I want all the data made into mm/dd/yyyy in the database table but not sure how to do that or what I am asking for.

 

Please help.

 

Cheers,

Colin

 

 

Link to comment
https://forums.phpfreaks.com/topic/147612-date-select-box/
Share on other sites

Actually, you don't want it like that.  You want to store it as either Unix Time or a MySQL Datetime stamp.  If you use your method, you will have to jump through hoops just to get a accurate date sort.

 

 

 

I want all the data made into mm/dd/yyyy in the database table but not sure how to do that or what I am asking for.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/147612-date-select-box/#findComment-774940
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.