Page 1 of 1

Login elapse time

Posted: Fri Aug 08, 2003 8:08 am
by Manuel-H
I am trying to display my login elapse time but encounter some problem. Hope someone can help

Run in phpmyadmin
***********
SELECT sec_to_time( (
(
to_days( '2003-08-08 20:51:43' ) - to_days( '2003-08-08 20:51:39' ) ) * 86400
) + ( time_to_sec( '2003-08-08 20:51:43' ) - time_to_sec( '2003-08-08 20:51:39' ) )
) AS elapsetime

elapsetime = 00:00:04

My code (the sql variable is the select string above)
*******
$result = mysql_query($sql);
$totalelapsetime = $result[elapsetime];
echo $totalelapsetime;

I got nothing from the echo $totalelapsetime.
When I echo out the $sql, I got the above select stmt.

What did I do wrong?