close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search Results not showing

Thread began 1/20/2014 4:24 pm by joerg431091 | Last modified 1/24/2014 10:21 am by joerg431091 | 689 views | 8 replies |

joerg431091

Search Results not showing

I have created a search form on one of our websites but the search results don’t show. What drives me crazy is that I have done the exact same (at least I thought so) on a different website and it works great. Even if I re-direct the form action to that other website, it works but if I leave it pointing just to products_Results.php it does not. So I suspect I must have something wrong in the Search Result Server Behavior on the products_Results.php page.

I tried to use the search wizard as well as the search tutorial but seem to always miss something. Any pointers are very much appreciated.

Here is my search form:

<form action="products_Results.php" method="get" name="WADASearchForm" id="WADASearchForm" class="search-form">
<input type="submit" value="Search" class="search-submit-button" />
<input type="text" placeholder="Search..." value="" name="ProductMetaKeywords" id="ProductMetaKeywords" class="search-text-box" />
<input type="Hidden" name="Search" id="Search" value="Search" />
</form>


Here is the Server Behavior for the DataAssist Search (WADAproducts) on the products_results.php page:

<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAproducts;
//Searchpage: products_search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if (isset($_GET["Search"]) || isset($_GET["Search_x"])) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch1->addComparisonFromEdit("ProductName","ProductName","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductMetaKeywords","ProductMetaKeywords","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductPrice","ProductPrice","AND","=",1);
$WADbSearch1->addComparison("ProductKeywords","ProductKeywords","OR","Includes",0);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_products_results"]=$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_products_results"]) && $_SESSION["WADbSearch1_products_results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_products_results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>

The exact same configuration works perfectly on one of our other websites. The main difference between the 2 products_results.php pages (the one on the site that works and the current one that does not) is the Recordset (WADAproducts) server behavior. Not sure whether this has something to do with this but wanted to mention it.

Any ideas are greatly appreciated.

Best,
Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the search and results pages as well as a link where i can see the problem.

Sign in to reply to this post

joerg431091

Hi Jason,

Thanks a lot. Attached, please find the copy of the index page that has the search form included as well as a copy of the products_Results page.

A link to the website with the search form on top is www.tedescohound.com

Thanks so much for your help.

Best,
Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

the recordset on the results page already has a number of conditions set to filter.

if you open the recordset and test it, does it return a result?

the recordset must be able to return a result when testing it in order for Data Assist search to be able to work with it.

if the recordset is defined in such a way that it wont return a result to begin with, there will be nothing for Data assist search to search from.

Sign in to reply to this post

joerg431091

It does not return a result (gives a no data) if I test it in dreamweaver but of course it returns a result on the website online. However - I have included the search into another website that also does not return data while testing in dreamweaver but works perfectly.

Sign in to reply to this post

Jason ByrnesWebAssist

if i visit the products page with out performing a search:
http://www.tedescohound.com/products_Results.php

it does not return anything, this is because the recordset is set to filter on a number of URL parameters outside of the data assist search settings, and if those URL variables don't exist, it wont return a result.

like I said, in order for the search to be able to return a result, the recordset must be able to return a result without performing the search.

Sign in to reply to this post

joerg431091

Could you check the other domain that we have and it works perfectly?

if you go to:

https://tedescotrade.com/products_results.php

you will also not get any results but you will get results once you search for it as well as with the navigation links.

I just don't understand why it works with the tedescotrade.com site but not with the other which is tedescohound.com

Sign in to reply to this post

Jason ByrnesWebAssist

Please provide a Skype username or a US phone number and a good time to contact you when you will be in front of your computer and we will have an engineer contact you to resolve this issue over the phone.

We are available Monday - Friday from 9am - 4pm EST (except major U.S. holidays).

Sign in to reply to this post

joerg431091

Hi Jason,

No need for the engineer at this point (thanks for the option). Your answers gave me some good information and we created a separate search_results.php page as a landing page for the search forms. This way we have more flexibility with the server behavior and the information displayed in the search results.

Thanks a lot for your help.

Joerg

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

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