[TYPO3-english] EXT: DB Integration (wfqbe) - Problem with search form query

sabine deeken sabine.deeken at web.de
Wed Mar 25 14:27:05 CET 2009


Hi Flo,
there is a hook to remove empty where clauses (it's described 
comprehensively in the extension manual).
with text input searchfields this works perfect (I had only problems 
with multiple selects)
so better read the manual first...
Sabine

Flo schrieb:
> Hi,
>
> I have a little problem with understanding the right way to do a search
> query.
>
> in the moment I have the following query:
>
> SELECT bdb_datenbank.ID, bdb_datenbank.Verlag, bdb_datenbank.Titel,
> bdb_datenbank.Thema, bdb_datenbank.Kurzbeschreibung, bdb_datenbank.Autor
> FROM bdb_datenbank WHERE bdb_datenbank.Titel LIKE '###WFQBE_TITEL###' OR
> bdb_datenbank.Autor LIKE '###WFQBE_AUTOR###' OR
> bdb_datenbank.Kurzbeschreibung LIKE '###WFQBE_KURZBESCHREIBUNG###' ORDER
> BY bdb_datenbank.ID ASC
>
> and in the searchform I have the 3 fields, wich search for "Autor",
> "Titel" and "Kurzbeschreibung".
> this works so far.
>
> but what I need is something like this:
>
> WHERE bdb_datenbank.Titel LIKE '%###WFQBE_TITEL###%'
>
> I need a %LIKE...% operator, if I add them before and after the marker,
> I would get the results I need, but if only one search field is filled
> out, the other 2 remains empty with 2 times "%", wich is displaying me
> all of my database entries (of course! ;))
>
> what is the right way to do this?
>
> best regards, flo weber
> _______________________________________________
> 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