comparison _xampp/contrib/oracle.php @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 <html>
2 <head>
3 <title>PHP und Oracle</title>
4 </head>
5 <body>
6 <h1>PHP und Oracle</h1>
7 <table border="1">
8 <tr>
9 <th>Interpret</th>
10 <th>Titel</th>
11 <th>Jahr</th>
12 </tr>
13 <?php
14 $db="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
15 (HOST=localhost) (PORT=1521)))
16 (CONNECT_DATA=(SERVICE_NAME=xe)))";
17
18 // Oracle 10g
19 //$db="//localhost/xe";
20
21 $c=ocilogon("hr", "geheim", $db);
22
23 $s = ociparse($c, "SELECT * FROM cds");
24
25 if(ociexecute($s))
26 {
27 while (ocifetch($s))
28 {
29 echo "<tr>";
30 echo "<td>".ociresult($s, "INTERPRET")."</td>";
31 echo "<td>".ociresult($s, "TITEL")."</td>";
32 echo "<td>".ociresult($s, "JAHR")."</td>";
33 echo "</tr>";
34 }
35 }
36 else
37 {
38 $e = oci_error($s);
39 echo htmlentities($e['message']);
40 }
41 ?>
42 </table>
43 </body>
44 </html>
45