PHP 5.2.14でoracle10gに接続

PHPの設定(php.ini)

extension_dir = "./"
extension=php_pdo.dll
extension=php_pdo_oci.dll

ソース(C:\oracle_test.php)

<?php
$user = "";
$password = "";
$tns = "";
$db = new PDO("oci:dbname=".$tns, $user, $password);
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare("SELECT SYSDATE FROM DUAL ");
$stmt->execute();
if($row = $stmt->fetch(PDO::FETCH_ASSOC)){
	echo $row['SYSDATE'];
}

結果

C:\>php oracle.php
10-08-18