Re: How to display my results?
| From: | Jeroen Houben | Date: | Mon, 10 Mar 2003 09:12:10 +0000 |
| Subject: | Re: How to display my results? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4123@lists.php.net to get a copy of this message | ||
Charles Kline wrote:
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: SELECTTry something like this SELECT tbl_funding.area_1, areas1.area_name AS area1, tbl_funding.area_2, areas2.area_name AS area2 FROM tbl_fundingtbl_funding.area_1, areas1.area_name, tbl_funding.area_2, areas2.area_nameFROMtbl_funding LEFT JOIN tbl_dra areas1 ON tbl_funding.area_1 = areas1.id LEFT JOIN tbl_dra areas2 ON tbl_funding.area_2 = areas2.idI get this returned when I try this in phpMyAdmin:area_1 area area_2 area4 Health Services and Systems 5 Mental Illness 3 Chronic Diseases 0 NULL 1 Acute and Traumatic Injury 2 Aging and AgeSo, 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 Hi
LEFT JOIN tbl_dra areas1 ON tbl_funding.area_1 = areas1.id
LEFT JOIN tbl_dra areas2 ON tbl_funding.area_2 = areas2.id
- Jeroen