Oci8.php patch

From: Date: Wed, 26 Sep 2001 17:19:29 +0000
Subject: Oci8.php patch
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-2068@lists.php.net to get a copy of this message
Here is a small patch to allow out params from oracle stored procedures. If no one objects I'll commit ex. $result = false; $sql = " BEGIN ? := validate(?, ?); END; "; $db = getGlobalDB(); $sth = $db->prepare($sql); $data = array(&$result, $username, $password); $res = $db->execute($sth, &$data); if($result){ // Do stuff } Yavo <-- Start patch ----------------------------------------------- --- oci8.php Wed Sep 26 19:49:56 2001 +++ oci8_patch.php Wed Sep 26 19:49:33 2001 @@ -367,10 +367,10 @@ } for ($i = 0; $i < $size; $i++) { if (is_array($data)) { - $pdata[$i] = $data[$i]; + $pdata[$i] =& $data[$i]; } else { - $pdata[$i] = $data; + $pdata[$i] =& $data; } if ($types[$i] == DB_PARAM_OPAQUE) { $fp = fopen($pdata[$i], "r"); @@ -381,7 +381,7 @@ } } } - if (!@OCIBindByName($stmt, ":bind" . $i, $pdata[$i], -1)) { + if (!@OCIBindByName($stmt, ":bind" . $i, &$pdata[$i], -1)) { return $this->oci8RaiseError($stmt); } } ------------------- End patch ---------------------->

« previous php.pear.dev (#2068) next »