PHP Classes

File: fwphp/glomodul/z_examples/ora11g/wishlist/public/PdoOciTest.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/ora11g/wishlist/public/PdoOciTest.php   Download  
File: fwphp/glomodul/z_examples/ora11g/wishlist/public/PdoOciTest.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: Update of fwphp/glomodul/z_examples/ora11g/wishlist/public/PdoOciTest.php
Date: 1 year ago
Size: 988 bytes
 

Contents

Class file image Download
<html>
    <head>
        <title>PDO OCI Test Page</title>
    </head>

    <body>
        <?php
        $pdo
= new PDO(
                       
'oci:dbname=localhost/XE',
                       
'jim',
                       
'mypassword'
       
);
       
$sql = "
            SELECT DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID, STREET_ADDRESS,
            POSTAL_CODE, CITY, STATE_PROVINCE
            FROM departments NATURAL JOIN locations
            ORDER by DEPARTMENT_NAME
            "
;
       
$stmt = $pdo->query($sql);
       
$result = $stmt->fetchAll();
       
?>
<table>
            <?php
           
foreach ($result as $row) {
               
?><tr><?php
               
foreach ($row as $item) {
                   
?><td><?php
                   
echo ($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;");
                   
?></td><?php
               
}
               
?></tr><?php
           
}
           
?>
</table>
    </body>
</html>