Jump to content

Null date in MySQL


kahodges

Recommended Posts

I have the following code:

$sql .=" where ( `date` is null or trim(`date`) = '' ) ";

 

I'm using MySQL date format, which is 0000-00-00. When the field is left blank, it leaves 0000-00-00 instead of null. Is there another way around this? If there's an entry in that field instead of null, it causes my php script to not display an entry on the screen.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/197872-null-date-in-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.