/[informatika.old]/html/ib.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

Annotation of /html/ib.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.2 - (hide annotations)
Mon Jul 31 20:58:05 2000 UTC (23 years, 9 months ago) by dpavlin
Branch: dbi
Changes since 1.1.2.1: +38 -0 lines
added DBI test

1 dpavlin 1.1.2.1 <?
2    
3     // test interbase library functions
4    
5     $dbh=ibase_connect("localhost:/tmp/informatika","dpavlin","dpavlin");
6     $sth=ibase_query($dbh,"select * from osobe where id < 10");
7     print "<table>";
8     while ($row=ibase_fetch_row($sth)) {
9     print "<tr><td>".implode("</td><td>",$row)."</tr></td>\n";
10     }
11     print "</table>";
12 dpavlin 1.1.2.2 print "<hr>";
13     print "<table>";
14     $sth=ibase_query($dbh,"select id,ime from osobe where id < 10");
15    
16     while ($row=ibase_fetch_object($sth)) {
17     $arr=(array)$row;
18     print "<tr><td>";
19     print $row->ime.$row->ID;
20     print "</tr></td>\n";
21     }
22    
23     print "</table>";
24    
25     print "<hr><hr>";
26    
27     // DBI test
28    
29     require('class.DBI');
30     $dbh = new DBI("dbi:interbase:/tmp/informatika","dpavlin","dpavlin");
31     $sth = $dbh->prepare("select * from osobe where id < 10");
32     echo $dbh->errstr;
33     $sth->execute();
34     echo $dbh->errstr;
35     print "<table>";
36     while ($row=$sth->fetchrow_array()) {
37     print "<tr><td>".implode("</td><td>",$row)."</tr></td>\n";
38     }
39     print "</table>";
40    
41    
42     $sth = $dbh->prepare("select * from osobe where id < 10");
43     $sth->execute();
44     print "<table>";
45     while ($row=$sth->fetchrow_hash()) {
46     print "<tr><td>".$row->ID."</tr></td>\n";
47     }
48     print "</table>";
49    
50 dpavlin 1.1.2.1 ?>

  ViewVC Help
Powered by ViewVC 1.1.26