[Typo3-dev] Newbie:Getting value from another table
Franz Holzinger
franz at fholzinger.com
Fri Jun 10 09:13:24 CEST 2005
> I'm writing my first extension which has got 2 tables
> rg_quotation: author (relation to rg_author), text
> rg_author: name, description
>
> I get values with $this->getFieldContent("author") or
> $this->internal["currentRow"]["author"].
>
> But because of the database relation I just get the uid of the author. =>
> How do I get access to his name?
In the DBAL SQL statement where you get the currentRow from you have to
use something like this:
SELECT * FROM rg_quotation, rg_author where rg_quotation.author =
rg_author.uid
Then you should be able to use
$this->internal["currentRow"]["name"]
to get the name of the author.
Franz
More information about the TYPO3-dev
mailing list