RE: [PHP-DB] mysql_fetch_objects
| From: | Liz Kimber | Date: | Mon, 15 May 2000 08:12:17 +0000 |
| Subject: | RE: [PHP-DB] mysql_fetch_objects | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19@lists.php.net to get a copy of this message | ||
Why not use mysql_fetch_row and do it by column number?
Most languages append numbers/letters to repeated column names for that
reason.. I guess MySQL didnt.
> -----Original Message-----
> From: Trevor Lanyon [mailto:trevor@clearoption.com]
> Sent: 15 May 2000 07:09
> To: php-db@lists.php.net
> Subject: [PHP-DB] mysql_fetch_objects
>
>
> I think this problem is a limitation of mySQL (yes, the computer's broken,
> it's never MY CODE) however I'd love a second opinion:
>
> I'm doing a left join on the same table twice, it contains addresses and
> each person can have up to two addresses. The SQL looks like so:
>
> select * from (tbl_user left join tbl_adds as tbl_work on
> user_work_add_id =
> tbl_work.add_id) left join tbl_adds as tbl_home on user_home_add_id =
> tbl_home.add_id where user_id = 20;
>
> The SQL executes perfectly, however when I try to reference the
> fields using
> the PHP routine mysql_fetch_objects, the field names have been
> repeated and
> there is no way to distiguish between home and work.
>
> Trevor Lanyon
> ClearOption Technologies
> http://www.clearoption.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>