quiero que una tabla que guarda los timestamp me muestre los resultados en días normales pero no lo consigo, alguien me puede ayudar?
éste es el código:
Código PHP:
function HCDaysLeft($id){
if($id == "self"){ $id = $this->id; }
if($GLOBALS['serverdb']->num_rows($GLOBALS['core']->select8($id)) > 0){
$datatotal = mysql_fetch_assoc($GLOBALS['core']->select8($id));
$difference = $datatotal['timestamp_expire'] - time();
if ($difference < 0){
$difference = 0;
}
$days_left = ceil($diff / 86400);
return $days_left;
} else {
return 0;
}
}
Código PHP:
mysql_query("SELECT timestamp_activated, timestamp_expire FROM user_subscriptions WHERE subscription_id = 'habbo_club' AND user_id = '".$id."' LIMIT 1");