camdenite Posted March 2, 2009 Share Posted March 2, 2009 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 Quote Link to comment Share on other sites More sharing options...
revraz Posted March 2, 2009 Share Posted March 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
camdenite Posted March 2, 2009 Author Share Posted March 2, 2009 Hi, Thanks for that but how do I post that to the database? Can you point me in the direction of a tutorial? Thanks for your advice. Cheers, Colin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.