View Single Post
Old 04-09-2009, 05:25 PM   #5 (permalink)
webosb
The Contributor
 
webosb's Avatar
 
Join Date: Nov 2007
Posts: 41
Thanks: 24
webosb is on a distinguished road
Default

I was able to get it to work with this query:

SELECT
round(
(
(SELECT unix_timestamp(signupdate) FROM users WHERE ipaddress = "10.10.1.100" ORDER BY signupdate DESC LIMIT 1)
-
(SELECT unix_timestamp(signupdate) FROM users WHERE ipaddress = "10.10.1.100" ORDER BY signupdate ASC LIMIT 1)
)/60) as elapsed
FROM users
WHERE ipaddress = "10.10.1.100" LIMIT 1;

i doubt that it's the most optimized way of doing it but it works..
__________________
"Things you can get access to, you should never memorize." -Albert Einstein
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
webosb is offline  
Reply With Quote