[TYPO3-english] special query

Markus Bucher markusbucher at gmx.de
Mon Oct 13 15:51:42 CEST 2008


Hi Christian,

Christian Tauscher schrieb:
> This mail was already posted in direct-mail list, but unfortunatelly no
> solution was found.
what a pity ;o)

> The cateory field ist a comma separated list of integers.
> 
> Trying to bild a special query looks first simple, but I failed finally.
> 
> Example: Select all recipients with cat 1 OR cat 32

You mean "Show me all the newsletter-recipients that ordered newsletter 
with category 1 or 32 (and not any other? Or at least with 1 but not 32?

Looks like a exec_SELECT_mm_query with fe_user and 
sys_dmail_feuser_category_mm, where direct mail stores the connection 
between the categories and the users.

the sql-table sys_dmail_feuser_category_mm
uid_local 	uid_foreign 	tablenames 	sorting
4		1	 			1
4		2	 			2

means that the user with id=4 has two categories assigned, cat-id 1 and 2.

To acces them you have to use exec_SELECT_mm_query with local_table 
fe_user and mm_table sys_dmail_feuser_category_mm.

-> 
http://typo3.org/fileadmin/typo3api-4.0.0/de/d07/classt3lib__DB.html#85043a3df0001c604ee0fc0987e7c544

> Created by direct_mail:
> 
> SELECT uid,pid,deleted FROM tt_address WHERE (
> 	newsletter = '1'
> 	AND (category & 1)=1

why
> (category & 1)=1

and not
category =1? What do you want to achieve?

HTH,

markus bucher


More information about the TYPO3-english mailing list