[TYPO3] First Extension attempt
Stephen Bungert
s.bungert at metrinomics.de
Wed Mar 12 16:37:21 CET 2008
Ok.
Thanks fort he help.
These returns a resource ID:
$this->query = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_foreign',
'tt_news_related_mm', $GLOBALS['TYPO3_DB']->fullQuoteStr('uid_local',
'tt_news_related_mm') . '=1' . $this->newsId, '', '', '');
$this->newsId
Is the tt_news ID extracted from GET vars, using t3lib_div::_GET().
Then I do this:
$this->result = $GLOBALS['TYPO3_DB']->sql_fetch_row($this->query);
This never shows anything.
Here is what is in 'tt_news_related_mm'.
uid_local uid_foreign sorting tablenames
1 3 1 tt_news
1 5 2 tt_news
I'm not very experienced with SQl, but shouldn't I get a result back because
ther are two rows in the table where the 'uid_local' = 1 ($this->newsId = 1
for this test)
-----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] Im Auftrag von Dmitry
Dulepov [typo3]
Gesendet: Mittwoch, 12. März 2008 14:56
An: typo3-english at lists.netfielders.de
Betreff: Re: [TYPO3] First Extension attempt
Hi!
Stephen Bungert wrote:
> I trying to make my first extension. When I try and view the page I see
> this:
>
> NO entry in the $TCA-array for the table "tt_news_related_mm". This means
> that the function enableFields() is called with an invalid table name as
> argument.
>
> What exactly does this mean?
>
> This was the code that made it:
>
> $this->query = $this->pi_exec_query("tt_news_related_mm", 0, '`uid_local`
> =1', '', '', '', '');
>
> What I want to do is just query the database. The table tt_news_related_mm
> seems to store the related artcile IDs fort t_news articles. I want to get
> the related ids so that I can display the related articles for a TT_news
> article in SINGLE view in the right column.
Use $GLOBALS['TYPO3_DB'] (class.t3lib_db.php) to query mm table. MM tables
are different, they are not defined in TCA and pi_exec_query will not work
for them.
Btw, you use double quotes while you should use single. Check TYPO3 coding
guidelines.
--
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
"Nothing is impossible. There are only limits to our knowledge"
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list