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
 [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

Pull Requests

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 Nov 22 09:01:29 2024 UTC