Attribute filter with SELECT ALL

Author Message

Gunnar Birkeland

Tuesday 02 May 2006 12:41:55 am

Hi

Im building a search enginge into my Log Database. It currently has 6 search criterias witch can be <i>empty</i> <b>OR</b> <i>not</i>.
So the sorting is done on a attribute_filter basis:
I have got 6 of these:

{def $first = array(190,'=',$avariable)}

wich i wrap into:

{def $searchstring = array( $first , $second[..........] )}

And finally puts into my fetch:

...
'offset', $view_parameters.offset,
'attribute_filter', $searchstring,
'limit', $numberOfObjects ) )} 
...

This works just fine, as long as one of my criterias are <b>NOT</b> empty.
So what i want to do is the following:
My six arrays must be able to contain a SELECT * if the $avariable is not set.
Like this

{def $first = array(190,'=', 'ALL')}

Thanks in advance for all replys.

------------------------------------
Gunnar Birkeland
http://www.enternett.no

</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24

Gunnar Birkeland

Tuesday 02 May 2006 1:02:22 am

Hi there

In case anyone wonders, a way around this is of course with the operator NOT LIKE, like this:

{def $first = array(191,'!=','phlaskdjf')}

This way every variable of this id that does not match the criteria gets fetched.

Thank me. (<i>This is becoming a habit...</i>)

-G

</major>
----------------------------
ez-version: 3.9.3.
PHP: 4.4.2-1
MYSQL: 4.0.24

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.