Re: Making a Variable from different tables with Matching Db fields?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 28, 2009 at 4:22 PM, Christoph Boget
<christoph.boget@xxxxxxxxx> wrote:
>> Well I'm stuck I have the AdminID but now I can't seem to use it to pull
>> workorders with that AdminID . I couldn't get your block to work Andrew :(
>> I think I'm just not using it right now that I have it...lol
>
> Because there is ambiguity w/r/t the columns you are selecting, you'll
> need to use aliases.
>
> http://dev.mysql.com/doc/refman/5.1/en/identifiers.html
>
> In your code, when you are referencing the column, do so using the
> alias.  That should solve your problem.
>
> thnx,
> Christoph
>
>

You're right about the ambiguity. I didn't even pay attention to his
SELECT list. Actually, though, in this case aliases aren't even
necessary. Since workorders.AdminID and admin.AdminID are going to be
the same value since that's a join condition, so the OP really only
needs to choose one and use it.

Andrew

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux