#21589 [Opn->Bgs]: mysql_fetch_assoc() and duplicate field names
| From: | georg@php.net | Date: | Sat, 11 Jan 2003 22:24:54 +0000 |
| Subject: | #21589 [Opn->Bgs]: mysql_fetch_assoc() and duplicate field names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29794@lists.php.net to get a copy of this message | ||
ID: 21589
Updated by: georg@php.net
Reported By: rabidvan@mail.ru
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Windows XP and 2000
PHP Version: 4.2.3
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2003-01-11 16:18:32] rabidvan@mail.ru
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 this bug report at http://bugs.php.net/?id=21589&edit=1