/[corp_html]/inc/stocks.inc
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 /inc/stocks.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Thu Apr 5 10:52:16 2001 UTC (23 years ago) by dpavlin
Branch: MAIN
Changes since 1.1: +1 -1 lines
close time is now 21:21:21

1 <?
2
3 /* returns:
4 $stocks hash array with date,time,type,current,change,high,low,open
5 $time string time (or CLOSE)
6 $date string date
7 trash:
8 $row, $sth, $row2, $sth2, datesytle (german)
9 */
10
11 $dbh->dbh_do("set datestyle='german'");
12
13 $sth2 = $dbh->prepare("select type from stocks_order order by ordinal");
14 $sth2->execute();
15 while ($row2=$sth2->fetchrow_hash()) {
16
17 $sql="select date(date),time(date),stocks.type as type,current,change,high,low,open from stocks where stocks.type='$row2[type]' order by stocks.date desc limit 1";
18 $sth = $dbh->prepare("$sql");
19 $sth->execute();
20 if ($row=$sth->fetchrow_hash()) {
21 $stock[]=$row;
22 $time=$row[time];
23 $date=$row[date];
24 }
25 }
26
27 if ($time == "23:23:23" || $time == "21:21:21") $time="CLOSE";
28
29 ?>

  ViewVC Help
Powered by ViewVC 1.1.26