|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-31 00:58 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 11:00:01 2025 UTC |
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 [@] => 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.