I am writing a php function in which i am taking 2 parameters ,start_date and end_date
I also want if both dates are Null then this function should return the all rows
Here is my mysql query
select COUNT(*) from demo_meeting where meeting_datetime > "2013-01-01 OR NULL" and meeting_datetime < "2013-09-10 OR NULL";
THis query is working properly if both dates are available if i am using both date as NULL it is returning the Zero rows .
PLease tell me how can i improve this query so that if both date are NUll then it could return the all meetings
Thanks
richardohas given good solution but you can do like this also: