Re: [PHP-DB] Need help with time calculation for a tracking system - it DOES involve DB work :)

2002-10-05 Thread Jason Wong

On Saturday 05 October 2002 03:45, Aaron Wolski wrote:

 Anyway.. everything as far as entering the time values, etc is working
 correctly except the calculation is NOT working as it should!!!

 $timeValue = date(g:i:s, $timeDifference);

 When I echo everything out to the browser this is what I get:

 The timeIn value is: 1033760057
 The timeOut value is: 1033760098
 The converted timeIn value is 3:34:17
 The converted timeOut value is 3:34:58
 The time difference between timeIn and timeOut is: 7:00:41

 You see.. the 7 is there... which represents 7 hours and 41 seconds that
 have elapsed. the 41 seconds is right.. but not the 7 hours!!!

date() returns the LOCAL time/date given a GMT/UTC timestamp. The timezone 
where your server is located is probably 7 hours ahead of GMT/UTC.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
If at first you don't succeed, you're doing about average.
-- Leonard Levinson
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Some data manipulation

2002-10-05 Thread Hatem Ben

hey all

i have a database of arrays like this :
Array
(
[0] = 2-
[1] = 8b2
[2] = 8#c3
[3] = 8b2
[4] = 8#f2
[5] = 4a2
[6] = 8a1
[7] = 8a2
[8] = 4a2
[9] = 4a2
[10] = 4a2

)

i just need to change in every string the last value when it is equal to 1,2
or 3
ex ::
 [0] = 2-won't be changed  [0] = 2-
 [1] = 8b2  will be changed to [1] = 8b6
 [2] = 8#c3 will be changed to[2] = 8#c7
 [6] = 8a1   will be changed to[6] = 8a

and so on

Thanks for any help
Hatem


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] $_POST And $_REQUEST

2002-10-05 Thread Shoulder to Shoulder Farm

Hi all,
What is the difference between the $_POST and $_REQUEST functions (I 
can't find it in the docs)?
Thanks, Taj


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] $_POST And $_REQUEST

2002-10-05 Thread Hatem Ben

$_REQUEST is an associative array consisting of the contents of $_GET,
$_POST, $_COOKIE, and $_FILES

http://www.php.net/manual/en/reserved.variables.php


- Original Message -
From: Shoulder to Shoulder Farm [EMAIL PROTECTED]
To: PHP Database List [EMAIL PROTECTED]
Sent: Sunday, October 06, 2002 1:50 AM
Subject: [PHP-DB] $_POST And $_REQUEST


 Hi all,
 What is the difference between the $_POST and $_REQUEST functions (I
 can't find it in the docs)?
 Thanks, Taj


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Some data manipulation

2002-10-05 Thread Rasmus Lerdorf

So loop through and check the last char.  Am I missing something that
makes this harder than the obvious:

  foreach($arr as $key=$val) {
$end = $val[strlen($val)-1];
switch($end) {
   case '1':  $arr[$key] = substr($val,0,-1); break;
   case '2':
   case '3':  $arr[$key] = substr($val,0,-1) . ((int)$end + 4); break;
}
  }

Not sure if you always want to add 4 to the last char when it ends in 2 or
3, but that was the only info you gave.

-Rasmus

On Sun, 6 Oct 2002, Hatem Ben wrote:

 hey all

 i have a database of arrays like this :
 Array
 (
 [0] = 2-
 [1] = 8b2
 [2] = 8#c3
 [3] = 8b2
 [4] = 8#f2
 [5] = 4a2
 [6] = 8a1
 [7] = 8a2
 [8] = 4a2
 [9] = 4a2
 [10] = 4a2
 
 )

 i just need to change in every string the last value when it is equal to 1,2
 or 3
 ex ::
  [0] = 2-won't be changed  [0] = 2-
  [1] = 8b2  will be changed to [1] = 8b6
  [2] = 8#c3 will be changed to[2] = 8#c7
  [6] = 8a1   will be changed to[6] = 8a

 and so on

 Thanks for any help
 Hatem


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php