Login elapse time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Manuel-H
Forum Newbie
Posts: 1
Joined: Fri Aug 08, 2003 8:08 am

Login elapse time

Post 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?
Post Reply