This topic is locked

Searching for multiple values in the same field

7/21/2009 12:01:51 PM
PHPRunner General questions
J
jje author

I need to setup a list page with a searching option for multiple vales in the same field using "OR" and "AND"

Is this possible?
Johan

J
Jane 7/22/2009

Johan,
unfortunately it's impossible to create this type of search on the list page.

I recommend you to use Advanced search and create aliases on the Edit SQL query tab for this purpose.

Here is a sample:

select

field1,

field1 as field1_b,

field1 as field1_c,

...

from TableName

T
Tane 9/3/2009

Is it possible to somehow implement this by generating a URL to advanced search with multiple conditions for a single column? A bit like below (which doesn't work - it only returns the record satisfying the last condition).
http://localhost/CH/Event_reports_list.php?a=advsearch&type=or&asearchfield[]=EVENT_ID&asearchopt_EVENT_ID=Equals&value_EVENT_ID=40&asearchfield[]=EVENT_ID&asearchopt_EVENT_ID=Equals&value_EVENT_ID=41&asearchfield[]=EVENT_ID&asearchopt_EVENT_ID=Equals&value_EVENT_ID=42
Tane



Johan,
unfortunately it's impossible to create this type of search on the list page.

I recommend you to use Advanced search and create aliases on the <b>Edit SQL query</b> tab for this purpose.

Here is a sample:

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->select

field1,

field1 as field1_b,

field1 as field1_c,

...

from TableName<!--QuoteEnd--></div><!--QuoteEEnd-->