/[corp]/esi/java/db.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /esi/java/db.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Tue Mar 26 12:06:21 2002 UTC (22 years, 2 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
use own xtime function

1 <?php
2
3 require("../dbi_pgsql.php");
4
5 $dbh = new DBI("corp","dpavlin","");
6 $sth=$dbh->prepare("set datestyle='german'");
7 $sth->execute();
8
9 $type='LSE';
10
11 $sql="select date(date) as date,xtime(date) as time,current as current,change from stocks where stocks.type='$type' order by stocks.date desc limit 1";
12
13 $sth = $dbh->prepare("$sql");
14 $sth->execute();
15 if ($row=$sth->fetchrow_hash()) {
16 # print "--$sql--<br>";
17 $t=explode(":",$row[time]);
18 $time="$t[0]:$t[1]";
19 $d=explode(".",$row[date]);
20 $date="$d[0].$d[1]";
21 }
22
23 # for close value fake time (now)
24 if ($time == "23:23:23" || $time == "21:21:21" || $time == "22:21:21" ) $time=date("G:i");
25
26 $current=sprintf("%0.2f",$row[current]);
27
28 print "#$date|$time|$current|$row[change]#\n";
29 ?>

  ViewVC Help
Powered by ViewVC 1.1.26