RichardODreamweaver wrote:
> For whatever reason, if I enter a date such as
2007/02/01, it highlights ALL
> records, even after that date.
>
> If I enter 2006/02/01, it will highlight all records not
updated <2007.
>
> It does not seem to be taking into account the MMDD.
>
> Does this make more sense?
Yes, it does make more sense. Without doing a lot of testing,
I'm
guessing that PHP is either treating 2006/02/01 as a
calculation and
producing the result 1003 (/ is the division symbol), or that
it's
treating both sides of your comparison as strings. In the
latter case,
even if the numbers are the same, MySQL will return the date
with
hyphens, not forward slashes, so you're not comparing like
with like.
What I have tested is the fact that strotime() accepts both
2006/02/01
and 2006-02-01 as valid date formats to create a Unix
timestamp. So the
solution is the same as I gave you before:
<?php if (strtotime($row_mergelookup['LASTCHECK'])
<strtotime($_POST['datethreshold'])) {
?>.......else.....etc.
Computers can do a lot of calculations at lightning speed,
but they're
simple creatures when it comes to logic. You must compare
like with
like. You know it's a date. I know it's a date, but to a
computer, it's
a bunch of numbers and symbols.
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/