LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-08-2003, 09:00 AM   #1
Manuel-H
Member
 
Registered: Apr 2003
Location: Singapore
Distribution: Slackware32/64, Ubuntu, Fedora, RHEL
Posts: 138

Rep: Reputation: 15
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQl account login, PHP agallant Programming 2 07-16-2004 12:01 PM
Problem getting PHP to recognize MySQL, Using PHP 4.0 and MySQL 4.0.20 d2army Programming 4 06-27-2004 09:54 PM
php4 mysql, installation, php-pages with mysql info stay empty dnla Linux - Software 2 03-14-2004 03:54 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 09:59 PM
PHP last time modified script time way off GabeF Programming 2 11-05-2002 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration