close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search feature not working on web site

Thread began 6/25/2012 11:43 am by sandy170299 | Last modified 6/26/2012 3:14 pm by sandy170299 | 2427 views | 15 replies |

sandy170299

Search feature not working on web site

On this page, advSearch.php, the search feature is not working as expected. I am using AND parameters with my criteria, but it's not returning correct results. it will recognize what's in the category or state fields, but will not recognize the keywords field and returns all results. I am including three separate fields in the db table for the keywords field - not sure if that makes a difference or not. Thank you!

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the page please so i can see the code.

Sign in to reply to this post

sandy170299

Attached is a zip file containing the search and results pages.

Attached Files
advResults.zip
Sign in to reply to this post

Jason ByrnesWebAssist

on the results page, change:

php:
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_POST["S_keywords"]))?$_POST["S_keywords"]:"")  ."","AND","=","%20AND%20","%20OR%20","%22","%22",0);




to:

php:
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_GET["S_keywords"]))?$_GET["S_keywords"]:"")  ."","AND","=","%20AND%20","%20OR%20","%22","%22",0);
Sign in to reply to this post

sandy170299

Sorry, Jason. That didn't work. Still came back with nothing when I enter a search word into the keywords field.

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

sandy170299

Jason ... now my simple, keyword search isn't working. It's returing all results, no matter what I enter in the field.

placesofinterestusa.dataride-previews.com

It's the search form that's in the page header.

This is my code:

<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: getListings;
//Searchpage: simple_search.php;
//Form: SearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr1 = array("listingName", "summary", "keywords");

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

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_simple_search"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_simple_search"]) && $_SESSION["WADbSearch1_simple_search"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_simple_search"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>

Thank you!!!

Sign in to reply to this post

Jason ByrnesWebAssist

cheange the method of the search form from POST to GET

Sign in to reply to this post

sandy170299

Jason, I'm still getting the same results, even after changing the action to GET.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the results.php page 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...