PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #3299

Update/Insert on mssql gives false Error

Details

Submitted2005-01-26 10:14 UTC
Fromphp_bug at cklowe dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version4.3.10
OSWin32/Apache2.52
Roadmaps(Not assigned)

Comments

[2005-01-26 10:14 UTC] php_bug at cklowe dot com

Description:
------------
In the version of Pear shipping with PHP 4.3.10 (DB.php v 1.58, mssql.php v 1.53) isManip queries (i.e. those with Update or Insert) are returning an Error , e.g.

nativecode=0 - Changed database context to 'blah'

even though the query was executed via query() sucessfully, and the database is indeed updated.

I've only tried this with mssql. The problem did not occur with the Pear version in 4.3.8

[2005-02-11 00:45 UTC] jeremy dot krahn at mcomi dot com

Using PHP 5.0.3, Apache 2.0.52 (Win32), and mssql.php 1.55, I was experiencing the same issue as reported by php_bug at cklowe dot com.

Changing lines 144 - 146 from
if (!$result) {
return $this->mssqlRaiseError();
}

to:

if (!$result) {
if (!$result && !$this->affectedRows()) {
return $this->mssqlRaiseError();
}

appears to have resolved the issue.