LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   PHP and MySQL - login elapse time (https://www.linuxquestions.org/questions/linux-general-1/php-and-mysql-login-elapse-time-80120/)

Manuel-H 08-08-2003 08:00 AM

PHP and MySQL - login elapse time
 
I am trying to diaply 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?


All times are GMT -5. The time now is 10:41 AM.