Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2010, 06:36
Nillus
 
Fecha de Ingreso: julio-2009
Mensajes: 28
Antigüedad: 17 años, 3 meses
Puntos: 0
Ayuda con Timestamp

Hola,
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;
        }
    } 
La función select8($id) es ésta:
Código PHP:
mysql_query("SELECT timestamp_activated, timestamp_expire FROM user_subscriptions WHERE subscription_id = 'habbo_club' AND user_id = '".$id."' LIMIT 1"); 
Gracias por la ayuda