ID: 10155
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: ODBC related
Operating System: Windows NT 4.0 build 1381
PHP Version: 4.0.4pl1
New Comment:
please try turning on autocommit or doing a commit command before your
script ends. Once again I am still unable to reproduce this locally...
still considered closed.
Previous Comments:
------------------------------------------------------------------------
[2002-04-04 19:07:57] [EMAIL PROTECTED]
Sorry...my PHP Configuration is:
'./configure' '--enable-inline-optimization'
'--with-apxs=/usr/local/apache/1.3.12/bin/apxs'
'--with-config-file-path=/usr/local/lib' '--disable-debug'
'--enable-memory-limit' '--with-gettext' '--without-pear'
'--with-regex=system' '--enable-mbstring' '--enable-mbstr-enc-trans'
'--with-iconv=/usr/local' '--with-gdbm=/usr/local'
'--with-dbm=/usr/local' '--enable-sockets' '--enable-versioning'
'--enable-ftp' '--with-imap' '--with-mcrypt=/usr/local'
'--with-mhash=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib'
'--with-zlib-dir=/usr'
------------------------------------------------------------------------
[2002-04-04 18:46:26] [EMAIL PROTECTED]
I am having the same or very similar problem:
(There's a bunch more code involved, of course, so I'm just including
relevant examples, below.)
<-------- START EXAMPLE ------->
<...appropriate persistent db access info...>
<...data-to-variable assignments...>
mysql_db_query("dbX","update tableX set col1='$data1' where
ID='$id'");
<...error-reporting code...>
echo mysql_affected_rows();
<------ END EXAMPLE ------>
Result: no affected rows, no errors, and no update
I tried adding a SELECT statement immediately following the UPDATE
statement, per this bug report's suggestion:
Result: 1 affected row, no errors, and no update
So PHP thought 1 row had been updated...but it had not been.
This is a piece of script that we have been using successfully for
about 4 months, but it started to malfunction about 3 weeks ago.
INSERT, and DELETE statements work fine.
Version Info/Configuration:
FreeBSD 4.4 Release i386
PHP v. 4.1.2 (same problem with 4.0.6, by the way...)
Apache/1.3.12 OpenSSL/0.9.6a
MySQL v. 3.23.44
Thanks.
------------------------------------------------------------------------
[2001-05-07 10:39:41] [EMAIL PROTECTED]
no feedback, considered closed. if untrue, please reopen the bug.
------------------------------------------------------------------------
[2001-04-16 23:14:21] [EMAIL PROTECTED]
can you please provide a very simple test case for me? all local
attempts here have not yielded the same results as you are seeing.
a sample schema, and script to reproduce this would be very nice. but
please make sure it's all in the simplest form...
------------------------------------------------------------------------
[2001-04-04 07:02:58] [EMAIL PROTECTED]
The database is Access 2000 with a few tables and relations set up in
the relationships area.
Put simply the update, insert and, possibly, delete querys all appear
to work perfectely with no errors reported, except that the database
ends up being unchanged afterwards. The only way I have been able to
fix this is to query the same table with a select before the end of the
script, the changes are then implemented.
I have played with autocommit and commit with no effect so I figure it
must be a bug in either PHP or the ODBC drivers.
Here is one of the scripts with a totally unecessary select towards
the end to make it work.
<html>
<head>
<?
/*
Site by Just Biz
http://www.justbiz.co.uk
[EMAIL PROTECTED]
+ 44 (0)870 841 3040
Project: Space Windows
Routine: ModifySeries2.php
Created: 23/03/01
Descrip: Modify series number, title and description, update database.
Also inserts new records.
Revision: a
Rev. Date 23/03/01
Descrip: Created.
Parameters - From ModifySeries.php form
*/
error_reporting(63);
require("Security.php");
require("OpenDatabase.php");
if($SeriesId == "-1") {
// Create append query
$Query = "insert into tbl_Series ";
$Query .= "(SeriesNumber, ShortSeriesTitle, Description) ";
$Query .= "values('$SeriesNumber', '$ShortSeriesTitle',
'$Description')";
}
else {
// Create update query
$Query = "update tbl_Series ";
$Query .= "set SeriesNumber= '$SeriesNumber', ShortSeriesTitle=
'$ShortSeriesTitle', ";
$Query .= "Description= '$Description' where (SeriesId = $SeriesId)";
}
$Result = odbc_do($Connect, $Query);
?>
<title>Space Windows - Series modified</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<?
print($Query."<br>");
$Query = "select SeriesId, SeriesNumber, ShortSeriesTitle, Description
from tbl_Series";
$Result = odbc_do($Connect, $Query);
while(odbc_fetch_row($Result)) {
print(odbc_result($Result,1));
print(odbc_result($Result,2)."<br>");
}
if(!$Result) print("<br>Failed");
Print("<h3>Database Updated for Series ".$SeriesNumber."</h3>");
?> <a href="ProductSeries.php">Return to Series Page</a>
</body>
</html>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10155&edit=1