Author | Message | Time |
---|---|---|
AC_Drkan | In some scripts i found, im trying to recreate them, heres my problem. [code]SELECT TO_DAYS(NOW())-TO_DAYS(FROM_UNIXTIME(logindate)) FROM members WHERE id = $mid[/code] 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: [code] Days Since Login: 13148 Days in Clan: 12916[/code] 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. [code] Days Since Login: 0 Days in Clan: 12917[/code] | December 30, 2005, 3:16 PM |
rabbit | [code]<?php list($y_check, $m_check, $d_check) = split('[-]', $row['last_login']); $y = date("Y"); $m = date("m"); $d = date("d"); $control = mktime(0, 0, 0, $m, $d, $y); $check = mktime(0, 0, 0, $m_check, $d_check, $y_check); $difference = $control - $check; $dsl = floor($difference / 60 / 60 / 24); ?>[/code]At least...that's how I do it... | December 31, 2005, 3:30 PM |