Bug #16029 Updated: Feature Request on mysql_fetch_array()
| From: | torben@php.net | Date: | Wed, 13 Mar 2002 01:09:15 +0000 |
| Subject: | Bug #16029 Updated: Feature Request on mysql_fetch_array() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2339@lists.php.net to get a copy of this message | ||
ID: 16029
Updated by: torben@php.net
Reported By: mjm@porter.appstate.edu
-Status: Open
+Status: Closed
Bug Type: MySQL related
Operating System: Linux 2.4 (intel)
PHP Version: 4.1.2
New Comment:
The data is returned from the server like that. What you can
do is:
'select tbl1.colA as tbl1_colA, tbl2.colA as tbl2_colA. . .'
Torben
Previous Comments:
------------------------------------------------------------------------
[2002-03-12 19:55:38] mjm@porter.appstate.edu
When you SELECT two columns from different tables with the same column
name in a JOIN, you cannot use column names is associative array keys.
It would be really nice when you did something like this:
-------
$result = mysql_query("SELECT tbl1.colA, tbl2.colA FROM tbl1 LEFT JOIN
tbl2 ON tbl1.colB = tbl2.colB");
$row = mysql_fetch_array($result);
-------
if you could then do something like this:
-------
$mydata1 = $row["tbl1.colA"];
$mydata1 = $row["tbl2.colA"];
-------
With the current behavior, you may only access the second array element
with its numerical index.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16029&edit=1