• Welcome to Valhalla Legends Archive.
 

Unixtimestamp question

Started by AC_Drkan, December 30, 2005, 09:16 AM

Previous topic - Next topic

AC_Drkan

In some scripts i found, im trying to recreate them, heres my problem.

SELECT TO_DAYS(NOW())-TO_DAYS(FROM_UNIXTIME(logindate)) FROM members WHERE id = $mid

im trying to figure out what to set logindats as in phpmyadmin. So far i have tried everything and have been unsuccessful. So my question is, i know what NOW() returns, and have tried to make it similar to logindate, but i can't seem to figure out this FROM_UNIXTIME function. If someone could help me out, it would be muchly appreciated.

It produces this:

Days Since Login: 13148
Days in Clan: 12916


I just got the scripts able to login yesterday, and im sure i have all the correct tables.


EDIT:
I found the error, the table just need to be listed as an int with 15 values, and somehow it works.


Days Since Login: 0
Days in Clan:            12917
"The Arguments of Today Result in the Wars of Tomorrow" - Quote By Muah.
<@Logan> I spent a minute looking at my own code by accident.
<@Logan> I was thinking "What the hell is this guy doing?"

<kow`> "There are 10 types of people in the world... those who understand binary and those who don't."
<SpaceRain> That's only 2 types of people, kow.
<SpaceRain> STUPID


<[TN]FBMachine> i got kicked out of barnes and noble once for moving all the bibles into the fiction section

God i love Bash.org.

rabbit

<?php
    
list($y_check$m_check$d_check) = split('[-]'$row['last_login']);
    
$y date("Y");
    
$m date("m");
    
$d date("d");

    
$control mktime(000$m$d$y);
    
$check mktime(000$m_check$d_check$y_check);

    
$difference $control $check;
    
$dsl floor($difference 60 60 24);
?>
At least...that's how I do it...
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.