cvs: php4 /pear/DB oci8.php
| From: | Charles Hagenbuch | Date: | Wed, 19 Jul 2000 14:43:15 +0000 |
| Subject: | cvs: php4 /pear/DB oci8.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-813@lists.php.net to get a copy of this message | ||
chagenbu Wed Jul 19 07:43:15 2000 EDT
Modified files:
/php4/pear/DB oci8.php
Log:
Updates to the oci8 driver from James L. Pine <jpine@valinux.com>:
ok, there are a few changes that make this thing act more like the other
wrappers now.
changed the DSN to take the tnsnames.ora name as host instead of database
(it makes more sense in terms of the dsn format) changed fetchrow() and
fetchinto() to include keys whose values are null, as well as return lob
contents as values
this is definitely the way things should have been done before, but this is
the first that people other than me have tried using the file. I'm sure
more things will come up shortly.
Index: php4/pear/DB/oci8.php
diff -u php4/pear/DB/oci8.php:1.1 php4/pear/DB/oci8.php:1.2
--- php4/pear/DB/oci8.php:1.1 Fri Jun 30 12:23:13 2000
+++ php4/pear/DB/oci8.php Wed Jul 19 07:43:15 2000
@@ -78,11 +78,11 @@
}
$user = $dsninfo['username'];
$pw = $dsninfo['password'];
- $dbname = $dsninfo['database'];
+ $hostspec = $dsninfo['hostspec'];
$connect_function = $persistent ? 'OCIPLogon' : 'OCILogon';
- if ($user && $pw && $dbname) {
- $conn = $connect_function($user,$pw,$dbname);
+ if ($user && $pw && $hostspec) {
+ $conn = $connect_function($user,$pw,$hostspec);
} elseif ($user && $pw) {
$conn = $connect_function($user,$pw);
} else {
@@ -193,13 +193,16 @@
*/
function &fetchRow($result, $getmode = DB_GETMODE_DEFAULT) {
if ($getmode & DB_GETMODE_ASSOC) {
- OCIFetchInto($result,$row, OCI_ASSOC);
+ $moredata=OCIFetchInto($result,$row,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
} else {
- OCIFetchInto($result,$row);
+ $moredata=OCIFetchInto($result,$row,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
}
if (!$row) {
return DB_ERROR;
}
+ if ($moredata==NULL) {
+ return NULL;
+ }
return $row;
}
@@ -217,11 +220,11 @@
*/
function fetchInto($result, &$arr, $getmode = DB_GETMODE_DEFAULT) {
if ($getmode & DB_GETMODE_ASSOC) {
- OCIFetchInto($result,$arr, OCI_ASSOC);
+ $moredata=OCIFetchInto($result,$arr,OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS);
} else {
- OCIFetchInto($result,$arr);
+ $moredata=OCIFetchInto($result,$arr,OCI_RETURN_NULLS+OCI_RETURN_LOBS);
}
- if (!$arr) {
+ if (!($arr && $moredata)) {
return DB_ERROR;
}
return DB_OK;