php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8009 mysql_fetch_array and same Column Name
Submitted: 2000-11-28 07:17 UTC Modified: 2002-04-27 14:09 UTC
From: hochstein at macron-ag dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3pl1 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
26 + 26 = ?
Subscribe to this entry?

 
 [2000-11-28 07:17 UTC] hochstein at macron-ag dot de
In the documentation it is said that if you use same column names the last one will win. That is so far ok.

However I think the following statement could be correctly transferred in an assoc. array:

SELECT tblOrderAddress.Street, tblDeliveryAdress.Street 
FROM tblCustomer AS tblOrderAddress, tblCustomer AS tblDeliveryAddress
WHERE .....;

It is correct that Street occurs twice as an attribute, but it is distinguishable by the preceding tablename.
Isn't it possible to change mysql_fetch_array, so that tablenames, if stated, are included in the assoc Array building process?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-27 14:09 UTC] jimw@php.net
mysql_fetch_array() just uses the names reported by the mysql client library. use 'SELECT table.fieldname AS name' to given them different names.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC