Jump to content

PHP date difference


adyre

Recommended Posts

I have something like this:

<?
$sql = mysql_query("SELECT data, DATE_SUB(data, INTERVAL 20 DAY) - CUR_DATE() as DATAX");
while($row = mysql_fetch_array($sql)){
print $row['datax'];
}
?>

And it displays somethink like 90 days even if 'data' is the current date......

If any of you can help, please do that.....

Or any other method so I can display how many days remaining until "data" its 20 days old.

I delete them automaticaly if they reach 20 days, but I can't post "X days remaining"...

Excuse my English, but I'm from Romania...
Link to comment
https://forums.phpfreaks.com/topic/10207-php-date-difference/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.