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.

eZ debug

Timing: Jan 18 2025 19:27:49
Script start
Timing: Jan 18 2025 19:27:49
Module start 'layout'
Timing: Jan 18 2025 19:27:49
Module start 'content'
Timing: Jan 18 2025 19:27:49
Module end 'content'
Timing: Jan 18 2025 19:27:49
Script end

Main resources:

Total runtime0.0175 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.0547152.6250
Module start 'layout' 0.00660.0035 741.679739.4453
Module start 'content' 0.01010.0054 781.125089.4609
Module end 'content' 0.01550.0019 870.585930.3047
Script end 0.0175  900.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002514.3523140.0002
Check MTime0.00116.1560140.0001
Mysql Total
Database connection0.00127.025610.0012
Mysqli_queries0.003218.206530.0011
Looping result0.00000.096810.0000
Template Total0.00158.810.0015
Template load0.00095.218410.0009
Template processing0.00063.539410.0006
Override
Cache load0.00063.521610.0006
General
dbfile0.00031.440580.0000
String conversion0.00000.057240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs