|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
#1 |
Hello, is this President Clinton? Good! I figured if anyone knew where to get some tang it would be you
|
![]() Hi guys and gals
I am trying to do the following: extract a date from my database, it is MySql and stored as a Date, ie. 2006-11-29 compare this date to todays date using date("Ymd") and find out if the date from the datbase is more or less than 7 days ago, I just cant get it to work! I won't copy my code here, since it is so messed up that nobody would understand it anyway! a working example would be Highly appreciated and almost worth giving a blowjob for.... almost ![]() |
![]() |
![]() |
![]() |
#2 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
select if('2006-11-01'>date_sub(curdate(),interval 7 day),'within the last week','more than a week old');
something like that will work. substitute your field name in the place where I put the date
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#3 |
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
|
I use this basic code to do something similar to what you are looking for.
PHP Code:
** DatabaseQuery(); is a self made database access function, so you will have to alter the query to suit your needs, but the rest is straightforward.
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare. |
![]() |
![]() |
![]() |
#4 |
Hello, is this President Clinton? Good! I figured if anyone knew where to get some tang it would be you
|
thanks guys, it works now
|
![]() |
![]() |
![]() |
|
|