close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple Field Search

Thread began 7/18/2012 8:44 am by bill173836 | Last modified 7/18/2012 12:52 pm by bill173836 | 2655 views | 22 replies |

bill173836

Multiple Field Search

I have a search form that only has 1 Form Field (ProductSearch) and I want the end user to be able to search either the name of the product (ProductName) or the product SKU (ProductSKU) using the same Form.
Here is now I have it on my results page but it's not working.

$WADbSearch1->addComparisonFromEdit("ProductSearch","ProductName","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductSearch","ProductSKU","OR","Includes",0);

Any help would be appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

Use only one criteria.

Set it to a key word search type, and select both the Name and SKU Fields as the columns to search

Sign in to reply to this post

bill173836

I tried that it still doesn't work. Here are the values created.

//keyword array declarations
$KeyArr1 = array("ProductName");
$KeyArr2 = array("ProductSKU");

//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"ProductSearch","AND","Includes","%20AND%20","%20OR%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr2,"ProductSearch","OR","Includes",",%20","%20","%22","%22",0);

Sign in to reply to this post

Jason ByrnesWebAssist

you are still using 2 criteria, not one.

you only need to use 1 criteria, and delete the second.

In the one criteria, Select both the Name and SKU Columns. The column select list when setting the criteria, is a multiple select list, it allows you to select multiple columns.

Sign in to reply to this post

bill173836

I'm not following you exactly. Is the criteria you're referring to the Search Form Value of the Database Field. I think this is what you're trying to say but I'm not sure.

//keyword array declarations
$KeyArr1 = array("ProductName");
$KeyArr2 = array("ProductSKU");

//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"ProductSearch","AND","Includes","%20AND%20","%20OR%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr2,"","OR","Includes",",%20","%20","%22","%22",0);

Sign in to reply to this post

Jason ByrnesWebAssist

Stop looking at the code. Go into the DataAssist Search server behavior.

You will see that there are 2 search criteria defined in the first screen.

you only need one, but set it to search both database columns

Instead of using one criteria to search one column and another criteria to search the second column, use one criteria to search both columns.

Sign in to reply to this post

bill173836

Here is a screen shot. If I understand you correctly. When you say criteria you mean the Column. This configuration still isn't working.

Sign in to reply to this post

bill173836

Here is a bigger image.
ProductSKU and ProductName are selected in the Column fields.

Sign in to reply to this post

Jason ByrnesWebAssist

This screen shot shows you editing one of the Criteria, this shows the settings for one of the 2 criteria that are applied.

When click finish on this screen shot, it show a listing of each criteria applied, and allow yo to select each one to edit it.

Sign in to reply to this post

bill173836

Screen Shot One.
You can see I have ProductSKU and ProductName selected in the Column with the Type set to Keyword and Value set to ProductSearch which is the name of my Search Field on the search page.

See next post please.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...