home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / contrib / oracle.php < prev    next >
Encoding:
PHP Script  |  2006-03-21  |  873 b   |  46 lines

  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.  
  46.