[Typo3] Simple sql query

Martin Visser visser at squarewise.com
Mon May 2 16:11:40 CEST 2005


Michael Johnston wrote:

> For starters, clearly "table=tt_content" is not going to pull records
> from a table called "_employees". Start by reading the TSRef for
> CONTENT.
> 
> here is an example of using CONTENT with a non-tt_content table:
> http://typo3.org/documentation/document-library/player_profile_basic/
> Extension_with_TypoS/
> 
> 
> Michael Johnston
> Planetactive
> On 2-May-05, at 10:00 AM, Martin Visser wrote:
> 
> > Hi,
> > 
> > I'm stuck: I want to execute a simple sql query and display the
> > output at the right position. I assume this has to be done with
> > TypoScript. If I try this:
> > lib.homeDirs = CONTENT
> > lib.homeDirs.wrap = <table id="schijven" border="0" cellspacing="0"
> > cellpadding="0" width="100%">|</table>
> > lib.homeDirs {
> >   table = tt_content
> >   select {
> >     pidInList = this
> >     orderBy = sorting
> >   }
> > }
> > Something does appear (at the right position), but it's not what I  
> > want.
> > 
> > This is the query: SELECT CONCAT(firstname," ",lastname) AS
> > name,abbreviation FROM _employees WHERE share='1' ORDER BY
> > firstname ASC
> > It has to be parsed like this:
> > <table [attribs]>
> > <tr><td [attribs]>&nbsp;</td><td [attribs]><a
> > href="__abbreviation__" target="_blank">__name__</a></td></tr>
> > </table>
> > 
> > Per records a '<tr>' should be parsed. abbreviation and name
> > are field from the database.
> > 
> > The part with <table></table> should be like this I assume:
> > lib.homeDirs.wrap = <table>|</table>
> > But that's as far as I come.
> > 
> > lib.homeDirs is defined in TemplaVoila. If I use something like:
> > lib.homeDirs = TEXT
> > lib.homeDirs.value = Foo bar
> > 'Foo bar' is parsed at the right position.
> > 
> > I'm a newbie in this, so please help me.
> > _______________________________________________
> > Typo3-english mailing list
> > Typo3-english at lists.netfielders.de
> > http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Hi,

I know that I can't get any data from tt_content if I want it from
_employees. I read the whole piece, but nowhere I can find anything to
use SQL. Everytime I find something like:
select {
	pidInList = this
}

never something like:
select {
	query = SELECT * FROM .....
}



More information about the TYPO3-english mailing list