#20826 [Opn->Fbk]: update statement in mssql_query causes Access Violation
| From: | sniper@php.net | Date: | Thu, 05 Dec 2002 14:44:34 +0000 |
| Subject: | #20826 [Opn->Fbk]: update statement in mssql_query causes Access Violation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26729@lists.php.net to get a copy of this message | ||
ID: 20826
Updated by: sniper@php.net
Reported By: pyfra@web.de
-Status: Open
+Status: Feedback
Bug Type: MSSQL related
Operating System: Windows 2000 Server
PHP Version: 4.3.0RC2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-12-05 07:12:19] pyfra@web.de
Since I upgraded from 4.23 to 4.3.0RC2 PHP is causing a lot of
SQL-trouble. We are using MS SQL-Server
2000/IIS/Win2000Server/PHP4.3.0-ORC2(isapi).
The trouble mainly is caused by using the UPDATE statement. Example:
$statement = "
UPDATE table1
SET name1 = 'anything'
WHERE name1 = 'something'
";
mssql_query($statement,$dbh);
Returns 'PHP has encountered an Access Violation at 01A95154' in the
browser window but the PHP-script dows not execute anything after the
query.
Strange enough a check of the database shows the query itself being
successful.
If I now replace
mssql_query($statement,$dbh);
with
$var = mssql_query($statement,$dbh);
the script continues working and everything seems to be ok.
But having an update statement in a loop you will have to change the
name of the variable (called $var above), otherwise this fails after
the first loop.
Further problems occuring with mssql-queries in selfdefined functions
... the above workaround seems not to work in functions.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20826&edit=1