using strtotime or Timestamp in mysql Select
I'm trying to select authors where the date in their record, pubMonth +
pubYear, has passed. I've tried several combinations of WHERE statements
but none of them are eliminating the records that are larger than $today,
and that is the only problem.
This is what I have at the moment:
$today = strtotime(date("Y-m-d"));
mysql_select_db($xxxxxxxxxx, $xxxxxxx);
$query_rsfindAuth = "SELECT Author.FirstName, Authors.level2,
Authors.pubMonth, Authors.pubYear
FROM Authors
WHERE (UNIX_TIMESTAMP(Author.pubMonth+Author.pubYear)
< $today) AND level2 = 'Nature'
But I've tried each of these, 'cause I'm kinda shooting in the dark.
WHERE ((Students.gradMonth+Students.gradYear) < " . $today . ") AND
level2 = 'Nature'
WHERE (Students.gradMonth+Students.gradYear) < $today AND level2
= 'Nature'
WHERE " . strtotime(gradMonth.gradYear) . " < $today) AND level2
= 'Nature'
WHERE gradMonth+gradYear) < $today) AND level2 = 'Nature'
WHERE (UNIX_TIMESTAMP(gradMonth+gradYear) < $today) AND level2 =
'Nature'
WHERE UNIX_TIMESTAMP(gradMonth+gradYear) < " . $today . ") AND level2
= 'Nature'
As always, thank you for your kind help.
No comments:
Post a Comment