From:             dgk at visskiss dot org
Operating system: OS X
PHP version:      5.2.1
PHP Bug Type:     MySQL related
Bug description:  mysql_fetch_array returns different values for ASSOC and NUM

Description:
------------
mysql_fetch_array returns different values for MYSQL_NUM and MYSQL_ASSOC

Reproduce code:
---------------
$query = "SELECT table1.*, table2.* FROM table1 LEFT JOIN table2 ON
table1.id = table2.id WHERE table1.data='foo'";
$result = mysql_query($query);
$row=mysql_fetch_array($result);

$row['id'] = NULL; //(there is no corresponding row for left join)
$row[0] = 2 //there is a value for id from table1...



Expected result:
----------------
same value for associative and numerical element

Actual result:
--------------
assoc picks up one value, num another...

seems only to occur for left joins where there is a null row for join 
criteria....

-- 
Edit bug report at http://bugs.php.net/?id=40940&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40940&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40940&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40940&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40940&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40940&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40940&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40940&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40940&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40940&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40940&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40940&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40940&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40940&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40940&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40940&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40940&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40940&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40940&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40940&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40940&r=mysqlcfg

Reply via email to