I can't quite get my head round what you mean! (Sorry - i really do hate dates)
You said:
use the unix timestamp: mktime(); and save >it in your database for every message.
So use a Timestamp for the exact date and time of each post, and call this field 'time' (For this example) - right?
You also put the query as:
"SELECT <fields> FROM <table> WHERE time>'$startdate' AND time<'$enddate'"
But 'time' will never be greater than $startdate because it will have to have been before the startdate. (As the startdate is always in the future.)
If this isn't what you meant please please explain in a bit more detail!
Many thanks!
Russ