MySQL datetime fields
| From: | Jason Murray | Date: | Wed, 06 Sep 2000 09:12:20 +0000 |
| Subject: | MySQL datetime fields | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15462@lists.php.net to get a copy of this message | ||
Hi folks,
Apologies for the OT post, but this is a quickie, and I'm desperate,
and I've tried to help here before :)
I have a 'datetime' field in a MySQL table. It is populated with an
"UPDATE table SET field = NOW() WHERE ID = $thisid" command when an
order is complete.
I'd like to know the SELECT syntax so that I could select all the rows
from 'table' where 'field' has not been set (in which case it'll be
'0000-00-00 00:00:00').
Problem is, "SELECT * FROM table WHERE field = '0000-00-00 00:00:00'"
*still* returns this row. For now I'm having PHP do an absolute check
on the value before I output, and I'm silently ignoring it if its not
all zero's.
Can anyone help me with this please? I'd rather not 'code around' it
this way with PHP, I'd rather get the correct results from MySQL...
Jason
--
Jason Murray
jasonm@melbourneit.com.au
Web Design Team, Melbourne IT
Don't believe everything you're foretold.