ID: 24879 Updated by: [EMAIL PROTECTED] Reported By: sm at grand-prix dot ru Status: Feedback Bug Type: MySQL related Operating System: Linux RedHat 9 -PHP Version: 4.3.3RC3-dev +PHP Version: 4.3.2 New Comment:
And I asked you to try the SNAPSHOT, NOT the latest stable release.. Previous Comments: ------------------------------------------------------------------------ [2003-08-01 08:45:02] [EMAIL PROTECTED] Please provide a complete but short example script and mysql db schema with which we can reproduce this ourselves. (we're not going to install vbulletin just to test this) ------------------------------------------------------------------------ [2003-08-01 04:02:21] sm at grand-prix dot ru ./configure : --with-mysql=/home/mysql --with-apache=../apache_1.3.27rusPL30.17_match --enable-track-vars ------------------------------------------------------------------------ [2003-08-01 03:59:27] sm at grand-prix dot ru I have installed recommended version (last stable, 4.3.2). Problem persist. Additional info: MySQL v3.23.56 Linux kernel v2.4.20 SMP ------------------------------------------------------------------------ [2003-07-31 13:33:27] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Also let us know what mysql version you're using, and what configure line was used to configure PHP. ------------------------------------------------------------------------ [2003-07-31 05:26:09] sm at grand-prix dot ru Description: ------------ In some cases mysql_fetch_array returns numbered array element, but does'nt returns it's named copy. This script was tested as a part of vbulletin's code. Bug: in the first case $user[userid] is empty, but $user[0] contains correct data. For other user - 2'nd case - all is OK. Behavior depends from data, returned by mysql. Reproduce code: --------------- $query_string = "SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost, avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar FROM user LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid WHERE user.userid=412"; $res = mysql_query($query_string,$link_id); $user = mysql_fetch_array($res); print_r($user); $query_string = "SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost, avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar FROM user LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid WHERE user.userid=287"; $res = mysql_query($query_string,$link_id); $user = mysql_fetch_array($res); print_r($user); Expected result: ---------------- Array ( [0] => 412 [userid] => 412 [1] => 6 [usergroupid] => 6 [2] => SM_1 [username] => SM_1 ....... Array ( [0] => 287 [userid] => 287 [1] => 6 [usergroupid] => 6 [2] => SM [username] => SM ....... Actual result: -------------- Array ( [0] => 412 [userid] => [1] => 6 [usergroupid] => 6 [2] => SM_1 [username] => SM_1 ....... Array ( [0] => 287 [userid] => 287 [1] => 6 [usergroupid] => 6 [2] => SM [username] => SM ....... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24879&edit=1
