php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: iam_simon at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-12-30 05:24 UTC] iam_simon at hotmail dot com
Description:
------------
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 adodb-errorhandler.inc.php 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. 


Simon

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', '192.168.0.2', '', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)')"); 
$conn->Close(); 

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

Actual result:
--------------
no error should be seen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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:

adodb.inc.php
adodb-errorhandler.inc.php  

The variable $s in "adodb-errorhandler.inc.php" 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:

FIXED!!!!!!

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

http://phplens.com/lens/lensforum/msgs.php?id=11403&x=1
 [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] derick@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 20:04:48 2022 UTC