Hello,
I have a photogallery I am working on for a client where I want new pictures to expire after 30 days. When the user uploads the pics it puts that days date in a field in my mySQL database (column is a date type). Basically, when a users surfs the page and hits the database I want to subtract the date the pics were uploaded to the current date. If it's more than 30 days the picture will disappear (or I will just have a graphic that says "NEW" and after the 30 days the "NEW" graphic will disappear).
I'm relatively new to PHP and would appreciate any help, pointing in the right direction, etc.
Please note, I have searched the archives for "Subtracting Dates" and found some good info but I just can't seem to get it right. I am able to convert both dates to a Unix timestamp via mktime and subtract that but not sure where to go from there. I tried dividing that by 84600 (number of secs in a day) but was fruitless. For example,
05/01/03 = 1012629600
06/01/03 = 1054443600
When I subtract I get: 41814000
When I divide by 84600, I get: 484 when I'm looking for 30.
Sorry if this seem so basic.
Lastly, if this isn't the correct forum please let me know and I will post in the correct one.
Thanks,
Joshua L. Ingram
ingramj@visionreptiles.com