RE: [PEAR] How to display my results?
| From: | Peter Meth | Date: | Sat, 08 Mar 2003 15:21:23 +0000 |
| Subject: | RE: [PEAR] How to display my results? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4113@lists.php.net to get a copy of this message | ||
Rename one or both of your fields using AS:
SELECT
tbl_funding.area_1,
areas1.area AS area_A,
tbl_funding.area_2,
areas2.area AS area_B
PS. I am assuming your select should say areas1.area, not
areas1.area_name to get result as shown.
-----Original Message-----
From: Charles Kline [mailto:ckline@rightcode.net]
Sent: Saturday, March 08, 2003 12:18 AM
To: pear-general@lists.php.net
Subject: [PEAR] How to display my results?
I have been messing with this query ALL DAY. I have finally gotten
MySQL to return the results I am looking for (in phpMyAdmin) but I am
using PEAR DB on my pages and I can't figure out how to get to the data
I need from this query.
Here is the query:
SELECT
tbl_funding.area_1,
areas1.area_name,
tbl_funding.area_2,
areas2.area_name
FROM
tbl_funding
LEFT JOIN tbl_dra areas1 ON tbl_funding.area_1 =
areas1.id
LEFT JOIN tbl_dra areas2 ON tbl_funding.area_2 =
areas2.id
I get this returned when I try this in phpMyAdmin:
area_1 area area_2 area
4 Health Services and Systems 5 Mental
Illness
3 Chronic Diseases 0
NULL
1 Acute and Traumatic Injury 2 Aging and
Age
So, there are two columns returned with the name area. I have no idea
what to do with this - I am trying to display the names that are in the
area fields.
Any clue?
Thanks
Charles
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php