I have the next question: I have a table with a 'datetime' field in it called "last_payment", the thing i want to do is to show the users how much days left to their subscription (its a monthly subscription) so basically if the value in last_payment is "2011-06-10 12:28:11" and today its 15/06/2011 i want it to show that they have 25 days left.
I have the current code and it doesn't matter how much time i played with it it doesn't work when im trying to pull the data from the MySQL but it works when i do a "mktime()" function..:
$today = time();
$row_ct = mysql_fetch_array($result_ct);
//Subscription Counting Funcrion for Clients
$cdate_c = mktime(0, 0, 0, 12, 31, 2009, 0);
$difference_c = $today - $cdate_c;
if ($difference_c < 0) { $difference_c = 0; }
The following aren't working:
$cdate_c = mktime($row_ct["last_payment"]);
$cdate_c = mktime(strtotime($row_ct["last_payment"]));
$cdate_c = date(strtotime($row_ct["last_payment"]));
Some help?