Darkmatter5 Posted June 22, 2009 Share Posted June 22, 2009 I have a datetime item in a table of my database. If it has no value or is set to "0000-00-00 00:00:00", how can I check if it's all zeros or has an actual date assigned to it? I tried is_null(), but it didn't work. Any help is appreciated! Link to comment https://forums.phpfreaks.com/topic/163288-solved-help-with-datetime-data-from-mysql/ Share on other sites More sharing options...
flyhoney Posted June 22, 2009 Share Posted June 22, 2009 I imagine you can just do something like this: <?php $query = "SELECT name FROM birthdays WHERE datetime > '0000-00-00 00:00:00'"; $result = mysql_query($query); while ($row = mysql_fetch_object($result) { echo $row->name.'<br />'; } ?> Link to comment https://forums.phpfreaks.com/topic/163288-solved-help-with-datetime-data-from-mysql/#findComment-861556 Share on other sites More sharing options...
Darkmatter5 Posted June 23, 2009 Author Share Posted June 23, 2009 Worked thanks! Link to comment https://forums.phpfreaks.com/topic/163288-solved-help-with-datetime-data-from-mysql/#findComment-861945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.