| Forest Liu 2005-03-23, 3:56 am |
| I suppose there is a " submit_time" field in your DB table, so you could:
"SELECT * FROM `tablename` WHERE `submit_time`>=3D".lastdays(3)
lastdays() is a function you could create using mktime(),time(), and date()
On Tue, 22 Mar 2005 16:28:39 -0500, Chris Payne <cjp@planetoxygene.com> wro=
te:
> Hi there everyone,
>=20
> OK I'm using the following in my query to display entries in the LAST 3
> days:
>=20
> DATE_SUB(CURDATE(),INTERVAL 3 DAY) <=3D ListingDate
>=20
> But it doesn't seem to affect the results, the date format in my DB colum=
n
> (ListingDate - datatype is Date) is 2000-00-00 as in year, month and date=
-
> is THAT the problem? That it needs to be an actual timestamp? If that i=
s
> the case I'm not sure how to approach this because the data MUST be in th=
e
> above format as it comes from a central DB every night. All I need to do=
is
> display the current date plus also the previous x amount of days in betwe=
en.
>=20
> I'm using PHP 4 with MySQL 4.0.22 (Not the latest MySQL I know, sigh).
>=20
>=20
> Chris
>=20
>=20
--=20
Sincerely,
Forest Liu(=E5=88=98=E4=BA=91=E8=B5=9F)
|