ID:               31771
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kstamenov at rocketmail dot com
 Status:           Bogus
 Bug Type:         MySQL related
 Operating System: RHEL Linux
 PHP Version:      5.0.3
 New Comment:

Correction: You should recompile PHP4 with 4.1.10 client 
library or you should install 4.1.10 server, which solves 
this problem too. 


Previous Comments:
------------------------------------------------------------------------

[2005-02-04 12:10:03] [EMAIL PROTECTED]

It's not a php bug, it's a bug in MySQL's query cache, 
which was fixed a few weeks ago (4.1.10). 
 
To solve this problem you should recompile PHP5 with a 
libmysql 4.1.10 (snaps.mysql.com) or disable the query 
cache. 

------------------------------------------------------------------------

[2005-02-03 02:53:21] mrangryfish at hotmail dot com

I have found the same thing as kstamenov where if you restart the mysql
server the script will work on the first version of php you access the
data on after you restart it.

EG if you restart the mysql service and run the php script from the
php5.0.3 server, then try and access it from the 4.3.2 server the php 5
script will return the correct results, and the php 4 script will return
the garbage array.

I havent checked running the php 4 as 4.3.10, but I guess running this
could work as it is similar to 5.0.3. But that would only be a
workaround.

------------------------------------------------------------------------

[2005-02-02 07:56:42] mrangryfish at hotmail dot com

I have this same problem, with Eventum code. I am attempting to use
Eventum 1.4 with PHP 5.0.3 and mysql 4.1.8 and the sql statements that
use mysql_fetch_array($sql, MYSQL_ASSOC) are returning bad results eg
(
    [#B] => 2
    [EMAIL PROTECTED] => AskIT
)
They should be returning something like 
(
[prj_id] => 2
[prj_title] => Tech Team
)

using mysql_fetch_assoc makes no difference.

I have had no problem running PHP 4 with the mysql 4.1.8 database
backend so I assume it is something wrong with the php 5.0.3 mysql
libraries with returning these associative indexed arrays?

I have even tried using the latest pear packages but it makes no
difference.

------------------------------------------------------------------------

[2005-01-31 00:58:12] kstamenov at rocketmail dot com

Description:
------------
This is related to bug #31600 which was marked bogus but I was able to
recreate the issue and isolate the event.

I am not familiar with the mysql interface inner workings so that might
be a MySQL bug.

The problem:
$query_str = "SELECT * FROM table";
will display incorrect result while "SELECT field1,field2 FROM table"
works as expected.
The issue is the same as the bug described in #31600

The problem occurs when MySQL 4.1 database is accessed from php4 script
then php is upgraded to php5(compiled with 4.1 libraries) and the script
tries to access the same database even with a different username with
correct password. 

It is solved when the database server is restarted. 

The problem though persists if the database is accessed from two
different servers running php4 and php5(compiled with 4.1 mysql lib) if
the php4 is first to access the database after restart the php5 one will
display the incorrect output and vice versa.



Reproduce code:
---------------
$query_str = "SELECT * FROM table";
$result = mysql_query("$query_str");
var_dump(mysql_fetch_assoc);


Expected result:
----------------
field1 ="value";
field2 = "value"
field3 = "value"
field4 = "value"

Actual result:
--------------
"B"="value;
"" = value;
missing
missing


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31771&edit=1

Reply via email to