This topic is locked
[SOLVED]

 Phone Data

5/10/2011 7:40:48 AM
PHPRunner General questions
S
swanside author

I have a problem with a phone bill, so I have downloaded the phone bill as a csv and imported it into my database,

Now I have these fields

-- phpMyAdmin SQL Dump

-- version 3.2.5

-- http://www.phpmyadmin.net

--

-- Host: localhost

-- Generation Time: May 10, 2011 at 12:37 PM

-- Server version: 5.1.34

-- PHP Version: 5.2.9-2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;

/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;

/*!40101 SET NAMES utf8 */;
--

-- Database: `phone`

--
-- --------------------------------------------------------
--

-- Table structure for table `phone`

--
CREATE TABLE IF NOT EXISTS `phone` (

`date` longtext NOT NULL,

`time` longtext NOT NULL,

`phone` longtext NOT NULL,

`username` longtext NOT NULL,

`network` longtext NOT NULL,

`dialled` longtext NOT NULL,

`description` longtext NOT NULL,

`data vol` longtext NOT NULL,

`events` longtext NOT NULL,

`duration` longtext NOT NULL,

`cost` longtext NOT NULL,

`id` int(11) NOT NULL AUTO_INCREMENT,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2048 ;

The problem I am having is, I want to be able to see what the time was between two different lines, so, In my list I have this

481 17-Dec-2010 13:57:00 320.45 KB mobile internet mobile internet 0 00:00:00 £0.000

483 17-Dec-2010 16:04:00 4.93 MB mobile internet mobile internet 0 00:00:00 £0.000



Now id on the first line is 481 and at 13:57:00 the phone downloaded 320.45 KB of data, then on id 483 at 16:04:00 the phone downloaded 4.93 MB of data.
I want to show the difference in times between the two fileds.

Any ideas please?

Cheers

Paul

Sergey Kornilov admin 5/10/2011

If your question is about calculating the difference between time values in two different records check this post:

http://stackoverflow.com/questions/5914465/php-calculation-downtime

S
swanside author 5/10/2011



If your question is about calculating the difference between time values in two different records check this post:

http://stackoverflow.com/questions/5914465/php-calculation-downtime


Spot on.

Thanks