Then the information in the DB is the same.

Jim
----- Original Message ----- 
From: "Charles Kline" <[EMAIL PROTECTED]>
To: "Rich Gray" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 07, 2003 10:03 AM
Subject: Re: [PHP] MySQL Alias and PHP


Thanks for the help. Almost there. Here is what I have:

SELECT x.id, x.headline, x.description, a.area area_a, b.area area_b
FROM tbl_funding x, tbl_dra a, tbl_dra b
GROUP  BY x.id LIMIT 0 , 30

The problem is that $array[area_a] and $array[area_b] display the same 
info.





On Friday, March 7, 2003, at 11:09 AM, Rich Gray wrote:

>> Hi all,
>>
>> I have this query:
>>
>> SELECT a.area_name, b.area_name FROM tbl_1 x, tbl_2 a, tbl_2 b
>> WHERE x.area_1 = a.id
>> AND x.area_2 = b.id
>>
>> I am using PEAR DB to get my results as an ASSOC ARRAY. How do I echo
>> the values for a.id and b.id?
>>
>> Thnks
>> Charles
>>
>
> I presume you mean area_name...
>
> Try this -> SELECT a.area_name as area_a, b.area_name as area_b FROM 
> tbl_1
> x, tbl_2 a, tbl_2 b
> Then you can refer to the columns as $array['area_a'] and 
> $array['area_b']
>
> HTH
> Rich
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to