On 21-Mar-2004, "Hayden Kirk" <spam@spam.com> wrote:
[color=blue]
> The problem I was having is what if I wanted to get both User_ID's from
> both
> tables... the array is only going to hold one of them.
>
> So I was wondering If I could use an alias, but everything I tried I got
> errors. So far this is what I have:
>
> select * from users, news where users.User_ID = news.User_ID order by
> news.News_ID DESC;
>
> But there will only be one User_ID in my array... how would I change this
> to
> make an alias? So like News.User_ID, User.User_ID?[/color]
I think I answered your question before, but here it is again
select users.User_ID as userid, * from ...
This will create an extra column called userid which will contain
users.User_ID.
You say you want both users.User_ID and news.User_ID but your select will
ensure they have the same value, so why do you need both??
If you really want both you would code something like
select users.User_ID as usersuserid, news.User_ID as newsuserid, * from...
This will create two extra columns, usersuserid and newsuserid.
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to
jamesbutler@willglen.net (it's reserved for spammers)