haku Posted July 9, 2009 Share Posted July 9, 2009 With this query: SELECT n.title, n.nid, UNIX_TIMESTAMP(td.deadline) as deadline, td.item_status, td.priority FROM {node} as n JOIN {to_do} as td ON n.vid = td.vid JOIN {to_do_assigned_users} as tdau ON tdau.vid = n.vid WHERE (td.deadline < (CURRENT_DATE() + INTERVAL 7 DAY) OR td.priority = 3) AND n.type = 'to_do' AND tdau.uid = 1 AND n.status = 1 AND td.item_status != 2 ORDER BY deadline LIMIT 5, 5 Can anyone see why the following query returns values in which td.deadline is NULL? It also doesn't seem to be returning values where td.priority is equal to 3. The following snipped also returns values where td.deadline is NULL: WHERE (td.deadline IS NOT NULL AND td.deadline < (CURRENT_DATE() + INTERVAL 7 DAY) or priority = 3) As does this: WHERE (td.deadline BETWEEN '0000-00-0 00:00:00' AND (CURRENT_DATE() + INTERVAL 7 DAY) or priority = 3) None of them are giving me any luck. Quote Link to comment https://forums.phpfreaks.com/topic/165322-solved-catching-null-values/ Share on other sites More sharing options...
haku Posted July 9, 2009 Author Share Posted July 9, 2009 I figured it out. I'm an idiot. I forgot to add a break into a php switch statement, and my data was getting overwritten with the results of a query in the next case down. Quote Link to comment https://forums.phpfreaks.com/topic/165322-solved-catching-null-values/#findComment-871856 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.