note 58573 rejected from function.mysql-fetch-assoc by nlopess
| From: | nlopess@php.net | Date: | Tue, 08 Nov 2005 18:25:06 +0000 |
| Subject: | note 58573 rejected from function.mysql-fetch-assoc by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-98262@lists.php.net to get a copy of this message | ||
Note Submitter: za at lombardiacom dot it
----
Try to use mysql_fetch_assoc to get two fields with the same name from different tables.
Example:
SELECT sell.prices, buy.prices
FROM sell LEFT JOIN buy ON sell.id=buy.id
You will get a one-item array contains: 'prices'=>a_value
The only way that I know to fix this problem is to change the query in this way:
SELECT sell.prices as 'sell.prices', buy.prices as 'buy.prices'
FROM sell LEFT JOIN buy ON sell.id=buy.id
Did someone know a better way to solve this?