Select between date range OR empty

Hi!

I currently have a query like this:

$search_query = @mysql_query("SELECT * FROM funerals WHERE surname LIKE '%".$surname."%' AND forenames LIKE '%".$forenames."%' AND died>='".$date1."' AND died<='".$date2."'");

Which works fine except that some of the entries for ‘died’ are empty and so the search doesn’t return those values. I tried this:

$search_query = @mysql_query("SELECT * FROM funerals WHERE surname LIKE '%".$surname."%' AND forenames LIKE '%".$forenames."%' AND (died='' OR died>='".$date1."') AND (died='' OR died<='".$date2."')");

but that doesn’t overcome it.

Could anyone shed any light on this for me please?

Thank you!

please do a SHOW CREATE TABLE for the table

it is unusual for a DATE column to allow empty strings as values, so i’m guessing you’re using VARCHAR

You could put an OR in there and search for blanks.