#21589 [NEW]: mysql_fetch_assoc() and duplicate field names

From: Date: Sat, 11 Jan 2003 22:18:32 +0000
Subject: #21589 [NEW]: mysql_fetch_assoc() and duplicate field names
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29793@lists.php.net to get a copy of this message
From: rabidvan@mail.ru Operating system: Windows XP and 2000 PHP version: 4.2.3 PHP Bug Type: MySQL related Bug description: mysql_fetch_assoc() and duplicate field names I have 2 tables: [table1] BLOCK_ID mediumint(8) SUB_ID mediumint(8) ... [table2] BLOCK_ID mediumint(8) ... I call query: SELECT * FROM table1 a, table2 b WHERE a.sub_id=b.block_id AND a.block_id=1; It works well. But when I use same query without aliases: SELECT * FROM table1, table2 WHERE table1.sub_id=table2.block_id AND a.block_id=1; In this case mysql_fetch_assoc() returns only 1 field BLOCK_ID and it's table2.BLOCK_ID. I think it's a bug in mysql_fetch_assoc() because MysqlFront returns table1.BLOCK_ID as BLOCK_ID and table2.BLOCK_ID as BLOCK_ID_1 Thank you. -- Edit bug report at http://bugs.php.net/?id=21589&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21589&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21589&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21589&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21589&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21589&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21589&r=support Expected behavior: http://bugs.php.net/fix.php?id=21589&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21589&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21589&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21589&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21589&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21589&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21589&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21589&r=gnused

« previous php.bugs (#29793) next »