close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


DataAssist Search Comparisons

Thread began 6/18/2013 9:05 am by stephen287384 | Last modified 6/19/2013 11:02 am by Jason Byrnes | 237 views | 3 replies |


DataAssist Search Comparisons

I have 2 search fields, one for keywords and the other for areas (suburb or postcode). They are both set to keyword and "includes" and "=" respectively.

I have 2 problems:
1. i want users to be able to search using either or both of the fields, eg: widgets Melbourne OR just Widgets OR just Melbourne.
2. Currently if a user searches for eg: camera melbourne the results are correct BUT if the user searches for eg: cameras melbourne there are NO results. I have tried "begins with" which does not work as the database records are eg: Nikon Digital Camera, so it would look at Nikon first and fail. I have tried changing the first filed to "includes" which only works for camera NOT cameras.

Sign in to reply to this post

Jason ByrnesWebAssist

1) if the user only fills in one field the other filed will not be included in the search. the other field will be ignored.

it sounds like you should use the OR seperator for your needs between the 2 keyword search criteria.

2) That is the way it is supposed to work.

the string "cameras" is not contained in the column "Nikon Digital Camera" so nothing is returned.

the includes criteria looks at each word:
cameras = Nikon | NO
cameras = Digital | NO
cameras = Camera | NO

so no result is returned when searching for cameras

a result is returned for camera because that is a word in the column:
camera = Nikon | NO
camera = Digital | NO
camera = Camera | YES

Sign in to reply to this post


When i change the second comparison to OR and search for camera it shows ALL database results.

//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_POST["what"]))?$_POST["what"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr2,"".((isset($_POST["area"]))?$_POST["area"]:"") ."","OR","=","%20AND%20","OR","%22","%22",0);

If a user was looking for a camera, they would most likely search for cameras, eg: "Digital Cameras", is there any way around this other than changing the records? Listing an item as eg: "Nikon D700 Digital Cameras" for a single camera would not be sensible.

I just did a Google search for "cameras" and both "camera" AND "cameras" came up in the results. How do they achieve this? Do they have a database column containing all keywords assosiated with the product?

Also i want it to work on EITHER or BOTH fields as some users would just search camera, other users would search for camera and the area. Is this possible?

Sign in to reply to this post

Jason ByrnesWebAssist

OK, I guess I'm not clear on what was wrong when you had the second criteria set to AND.

if when using and for both, it should ignore the criteria if you leave it empty. It should only e part of the search if you enter a value.

as for the google search, a well designed web site will have a keywords meta tag for each page. The web site developer will add a keywords list to this meta tag that should return the page. So in the case of searching for cameras the keywords meta tag would contain both cameras and camera:

<meta name="keywords" content="cameras, camera">

you could create a similar column in your database and use that column in the search rather than the item name column.

Sign in to reply to this post

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





Ease of use


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...