User Tools

Site Tools


kurs:pear-db.php
<?php
include_once('DB.php'); 

define("NR_DB_CONNECTION",'oci8://hr:hr@orcl11');

$dbh = DB::connect(NR_DB_CONNECTION);


// prepare statment
$stmt = "SELECT first_name, last_name FROM employees";

$result=$dbh->query($stmt);

$mode = DB_FETCHMODE_ASSOC;

while ($row = $result->fetchRow($mode)){
	print "<pre>";
	print_r($row);
	print "</pre>";
}

// Database disconnect
$result->free();
$dbh->disconnect();
?>
kurs/pear-db.php.txt · Last modified: 2014/09/10 21:22 (external edit)