$query="SELECT field FROM Table WHERE (UNIX_TIMESTAMP(arrival)+nights*86400-86400+3600)>='$thisdate')";
When the arrival date is in Summer, adding a number of night requires
adjusting for the hour , because the UNIX_TIMESTAMP is DST whereas I had adjusted $thisdate to GMT to be free of time saving complications.
When the arrival date is in Winter, I don't need to add the hour.
I added a condition like: "&& arrival<'2004/10/31'..." to differentiate.
I realise now that I have to think about what if the Winter arrival date plus the nights brings the total back to Summer.
..seeing as I did not know the mysql expression for GMT timestamps, which would be easier.
Thanks to all.
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php