From:             [EMAIL PROTECTED]
Operating system: GNU/Linux 2.4 (intel)
PHP version:      4.1.2
PHP Bug Type:     MySQL related
Bug description:  mysql_fetch_array() fails to index array correctly

After some frustration, I performed the following SELECT query (column
names have been changed):

$result = mysql_query("SELECT tbl1.colA, tbl2.colB, tbl2.colC FROM tbl1
LEFT JOIN tbl2 ON tbl1.colD = tbl2.colD WHERE tbl1.colE = "myvalue" ORDER
BY tbl1.colF DESC, tbl2.colC ASC, tbl2.colD ASC", $handle);

I executed the following statements:

$row = mysql_fetch_array($result);
print_r(array_keys($row));

The output looked like this:

Array ( [0] => 0 [1] => 1 [2] => colB [3] => 2 [4] => colC )

This doesn't make any sense. When you SELECT from a LEFT JOIN it would
make sense for you to be able to access the array like this (IMHO):

$row["tbl2.colB"], $row["tbl2.colC"], etc...


since two columns in the select could have the same name but different
values.
-- 
Edit bug report at http://bugs.php.net/?id=16028&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16028&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16028&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16028&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16028&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16028&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16028&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16028&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16028&r=submittedtwice

Reply via email to