Gossamer Forum
Home : Products : DBMan : Customization :

Complex Search Fields

Quote Reply
Complex Search Fields
I was wondering if anyone can help with this. I want to combine three drop down menus from the advanced search form to search for the combination of the three within the same field in the database. (they may or may not be in the same order as in the field in the database)

In part of my db.cgi in the sub query
I have:

Code:
if ($in{'Temp1'} || $in{'Temp2'} || $in{'Temp3'}) {
$in{'keyword'} = ("$in{'Temp1'} $in{'Temp2'} $in{'Temp3'}");
$in{'bool'} = "and";
}
and this works perfectly, however, I need to save the keyword type of search for another part of my complex search engine.

I thought that since the aboved worked, I could just combine the search criteria into the Fieldname and let the sub query do the rest. ie

Code:
if ($in{'Temp1'} || $in{'Temp2'} || $in{'Temp3'}) {
$in{'Field1'} = ("$in{'Temp1'} $in{'Temp2'} $in{'Temp3'}");
$in{'bool'} = "and";
}
Unfortunately, this doesn't work. Not sure why. Looking at what is in the 'Field1' variable after testing both looks the same. The only exception is that the 'keyword' search fills up every field variable with its search criteria, while my second code only fills the desired Field variable with the search criteria.
Does anyone know what part of the sub query programming would make the first code work but not the second code.

Is it possible to have a 'AND' search within the same field in combination with an 'AND' search of other search criteria in other fields.
I have the boolean mod working, and was wondering perhaps there would be a way to add a 'keyword2' search to it.

Any thoughts
Trev