C:\xampp\contrib\oracle.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>PHP und Oracle</title>
</head>
<body>
<h1>PHP und Oracle</h1>
<table border="1">
<tr>
    <th>Interpret</th>
    <th>Titel</th>
    <th>Jahr</th>
</tr>
<?php
    $db
="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
       (HOST=localhost) (PORT=1521)))
       (CONNECT_DATA=(SERVICE_NAME=xe)))"
;

    
// Oracle 10g
    //$db="//localhost/xe";

    
$c=ocilogon("hr""geheim"$db);

    
$s ociparse($c"SELECT * FROM cds");

    if(
ociexecute($s))
    {
        while (
ocifetch($s)) 
        {
            echo 
"<tr>";
            echo 
"<td>".ociresult($s"INTERPRET")."</td>";
            echo 
"<td>".ociresult($s"TITEL")."</td>";
            echo 
"<td>".ociresult($s"JAHR")."</td>";
            echo 
"</tr>";
        }
    }
    else
    {
    
$e oci_error($s); 
        echo 
htmlentities($e['message']);
    }
?>
</table>
</body>
</html>

x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586