[Typo3-dev] Building MySQL queries with selectConf array

Sabine Deeken sabine.deeken at web.de
Wed Jul 14 17:57:55 CEST 2004


Hi Ingmar				

sorry for replying  again to this rather old thread.. 

I would really love to read  the documentation you referenced, 

http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=318&cHash=a98cb4e7e6
,  and find out how i could manage it all by typoscript  (I'm having a bad time with my second extension..),

but it's a dead link. could you give me a hint  where I can find it now?


lots of thanks,

- Sabine Deeken (sabined)

-----------------------
This thread is located in the archive at this URL:
http://typo3.org/documentation/mailing-lists/dev-list-archive/thread/21951/
					
> Sacha Vorbeck wrote:
> > in the news and faq plugin MySQL queries are glued together with an
> > array which is then passed to a function.
> >
> > The array is filled like this:
> > $selectConf["where"] = "1=1 ".$where;
> > $selectConf["orderBy"] = "title";
> > $selectConf["where"].=" AND category=".$this->catExclusive;
> >
> > and is then passed to a function:
> > $query = $this->cObj->getQuery("tx_faq_faq",$selectConf);
> >
> > The only chance I see adding a limit to the query is:
> > $query .= " LIMIT 0,5";
> >
> > Is there another way? Maybe something like $selectConf["limit"] = "0,5";
> > (which doesn`t work).
> >
> > It seems that the getQuery() function always selects all fields. Is
> > there a way to restrict the query only to certain fields of a table?
> >
> > I wanted to take a look at the function getQuery() but I couldn`t find
> > it.
> 
> OK, just read this:
> 
> Robert Lemke wrote:
> > Just generate the TS in your script and use one of the cObj
> > functions
> 
> !!!
> 
> > (see class.tslib_content.php). Try this:
> >
> >     $lConf = array ();
> >     $lConf["params"] = 'hspace=1 vspace=1';
> >     $lConf["file."]["maxW"] = 100;
> >     $lConf["file"] = 'uploads/'.$blob_field_containing_filename;
> >     $imgCode = $this->cObj->cImage($lConf["file"],$lConf);
> 
> So what does that mean?
> It means you can call any function/cObject or anything which is
> mentioned in the TSRef by calling it directly from PHP, and setting the
> TypoScript which is normallybpassed to the function, as the conf array.
> 
> Now, in your case, you are attempting to use the query function.
> In the TSRef it is called "select".
> 
> See:
> http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=318&cHash=a98cb4e7e6
> 
> And there you'll find a nice reference of what's possible and what isn't.
> 
> Sacha Vorbeck wrote:
> > I still don`t understand what the reference to $this-cObj really means.
> $this->cObj refers to the class tslib_cObject!
> Read it carefully until the end ;-) and you'll understand a lot more
> about Typo3!
> 
> - Ingmar
> 
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
> 





More information about the TYPO3-dev mailing list