mel_bagley Posted April 3, 2006 Share Posted April 3, 2006 Hi All,I've got a mySQL table with the following fields:id, name, expiryDateThe expiry date is in the format dd/mm/yyyy and I would like to show only the dates newer than those in the db, for example1,chair,09/08/20062, balloon, 05/03/20063, brick, 12/04/2006today's date = 03/04/2006 phpdate = (2006-04-03 00:00:00)What would I need to be able to cycle through the table and return the results but leaves out the past results e.g. balloon.Many thanks in advance.Kind RegardsMel Link to comment https://forums.phpfreaks.com/topic/6473-how-do-i-work-out-a-past-date-in-php-mysql/ Share on other sites More sharing options...
Barand Posted April 3, 2006 Share Posted April 3, 2006 MySQL gives you DATE and DATETIME column type and dozens of functions to use with them. Why igmore them invent your own type? Store dates in a database to be functional, not to look pretty. You can format them any way you want when you query the table or output the results. Link to comment https://forums.phpfreaks.com/topic/6473-how-do-i-work-out-a-past-date-in-php-mysql/#findComment-23659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.