DB_common fix

From: Date: Sun, 24 Dec 2000 12:38:08 +0000
Subject: DB_common fix
Groups: php.pear 
Request: Send a blank email to php-pear+get-748@lists.php.net to get a copy of this message
Man that code was stupid. With the patch attached below, prepare/execute began to work for me. Is it right? -- Stay tuned, MhZ mailto:mookid@sigent.ru ----------- We have DIFFERENT amounts of HAIR --

--- DB/common.php.orig Tue Dec 19 17:06:34 2000 +++ DB/common.php Sun Dec 24 15:33:30 2000 @@ -34,7 +34,6 @@ var $type; // DB type (mysql, oci8, odbc etc.) var $prepare_tokens; var $prepare_types; - var $prepare_maxstmt; var $error_mode = PEAR_ERROR_RETURN; var $error_level = E_USER_NOTICE; var $error_callback; @@ -344,6 +343,9 @@ function execute($stmt, $data = false) { $realquery = $this->executeEmulateQuery($stmt, $data); + if (DB::isError($realquery)) { + return $realquery; + } $result = $this->simpleQuery($realquery); if (DB::isError($result) || $result === DB_OK) { return $result; @@ -363,7 +365,6 @@ function executeEmulateQuery($stmt, $data = false) { $p = &$this->prepare_tokens; - $stmt = (int)$this->prepare_maxstmt++; if (!isset($this->prepare_tokens[$stmt]) || !is_array($this->prepare_tokens[$stmt]) ||
« previous php.pear (#748) next »