viion Posted August 1, 2009 Share Posted August 1, 2009 I'm trying to order an event list by dates. What is the best way to go about doing this? I tried setting the field type to "date" but no matter what the value is, it just keeps inputting 00-00-0000 Quote Link to comment https://forums.phpfreaks.com/topic/168447-how-to-insert-into-a-date-type-column/ Share on other sites More sharing options...
gevans Posted August 2, 2009 Share Posted August 2, 2009 You must be inputting the value wrong. Can you show your input query? It should be something like this... <?php $date = date("Y-m-d"); mysql_query("INSERT INTO `your-table` VALUES ('$date', 'other inputs?')"); Quote Link to comment https://forums.phpfreaks.com/topic/168447-how-to-insert-into-a-date-type-column/#findComment-888593 Share on other sites More sharing options...
viion Posted August 2, 2009 Author Share Posted August 2, 2009 the query is very same but it's more like column='$date', column='$otherdata', and so on. Quote Link to comment https://forums.phpfreaks.com/topic/168447-how-to-insert-into-a-date-type-column/#findComment-889054 Share on other sites More sharing options...
gevans Posted August 2, 2009 Share Posted August 2, 2009 Can you show your input query? Quote Link to comment https://forums.phpfreaks.com/topic/168447-how-to-insert-into-a-date-type-column/#findComment-889056 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.