I'm querying a database trying to find records added within 30, 60, or 90 days. I have a form where the user picks the timeframe, and the query works:
SELECT * FROM database WHERE (TO_DAYS(dateadded)-TO_DAYS(Now())>=-30)
+ ORDER BY dateadded DESC, ID DESC
We're showing 20 results at a time, so I embed the query into a "NEXT" link but this code doesn't work in a string:
I'm not sure how to get around this. The less than sign doesn't translate into the string. Any help would be appreciated.
UPDATE: Never mind. I figured it out. Duh.