JSHINER Posted April 10, 2007 Share Posted April 10, 2007 You must enter it as 2007-04-31 - on the form. Quote Link to comment Share on other sites More sharing options...
papaface Posted April 10, 2007 Author Share Posted April 10, 2007 I dont want to. Thats not how we do dates here in the UK. Quote Link to comment Share on other sites More sharing options...
per1os Posted April 10, 2007 Share Posted April 10, 2007 The date/time field in MySQL can be formatted a certain way. Do you have the createtable statement. Because if you want it in that format you will need to alter the table to reflect that format this way you can enter the dates into the DB the way you want. Without that you have to convert them the same as the database is. Databases are picky when it comes to dates. Quote Link to comment Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Here's something you can take a look at about converting date formats: http://www.phpfreaks.com/forums/index.php/topic,127739.0.html It's a tricky thing, and yes, databases are VERY picky about dates - either they're perfect, or do not get entered at all. Quote Link to comment Share on other sites More sharing options...
papaface Posted April 10, 2007 Author Share Posted April 10, 2007 Okay thanks. I'm just going to make them enter it in the way the DB likes. I cba to mess around with it. Thanks for all your help Quote Link to comment Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Yes good idea - make the database happy and you will be happy. Just put below the form field (Ex: 31-04-2007) so they know how to enter it. Good luck! Quote Link to comment Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Also - go ahead and hit that SOLVED button at the bottom. Quote Link to comment Share on other sites More sharing options...
per1os Posted April 10, 2007 Share Posted April 10, 2007 Really if you are not planning on viewing the raw data like via phpmyadmin all the time I would insert dates as an INT(11) and just enter the UNIX timestamp into the DB, that way you can easily manipulate the date anyway you want to. 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.