|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31343 Bug on Insert and Update with PHP 5.0.3
Submitted: 2004-12-30 05:24 UTC Modified: 2004-12-31 12:19 UTC
From: iam_simon at hotmail dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 5.0.3 OS: Windows 2000 with Apache 1.3.33
Private report: No CVE-ID: None
 [2004-12-30 05:24 UTC] iam_simon at hotmail dot com
I have been using ADODB (a pouplar PHP database wrapper) for several years and recently I upgraded to PHP 5.0.3 on Apache 1.3.33 with MSSQL. I got tons error messages from log generated by whenever my app uses "INSERT" or "UPDATE" to the database. There is no problem with "SELECT" statement.

This is a problem with PHP 5.0.3 only,  5.0.2, 4.0.x or below doesn't have this problem. 

I contacted author of ADODB, Mr. John Lim said it is a MSSQL/PHP bug, so I am trying to report this bug here.

Although there is an error, but the row has successfully inserted into the database.  I am using latest version of Adodb. 


Reproduce code:
$conn = &ADONewConnection('mssql'); 
$conn->Connect("hostname", "user", "pass", "dbname"); 
$conn->Execute("INSERT INTO visitor_log(date_stamp, ip, host, agent) Values('2004-12-29 07:10:52PM', '', '', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)')"); 

Expected result:
mssql error: [0: ] in EXECUTE("INSERT INTO visitor_log(date_stamp, ip, host, agent) Values('2004-12-29 06:59:18PM', '', '', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)')")

Actual result:
no error should be seen


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-30 05:31 UTC] iam_simon at hotmail dot com
You need to include() both of the following files from ADODB package:  

The variable $s in "" contains the error message.
 [2004-12-30 20:23 UTC] liang at saga-city dot com
We have the same problem, 
even after adding the "include files". 
The error shows  "SQL Execute failed" ,
but it actually works and success.
 [2004-12-31 04:10 UTC] jlim at phplens dot com
Josh Berkus says this is the problem:


The problem is in the latest implementation of the php_mssql.dll library for PHP >=4.3.10

A bug tracker request has been submitted. For now, the thing to do is swap out the 4.3.10 php_mssql.dll for 4.3.9 or earlier. I am using the dll from 4.3.7 and it works. According to the bug tracker, the last version it worked in was 4.3.9
 [2004-12-31 05:23 UTC] iam_simon at hotmail dot com
I tried swapping my 5.0.3 dll with 5.0.2 php_mssql.dll in c:\php\ext, but my Apache didn't start. It said "unable to initialize module... " error.  Any workaround for Php 5.0.3?  or did I do something stupid?
 [2004-12-31 12:19 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 22:01:29 2024 UTC