close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

After performing a search only the found records are showing on the results page

Thread began 10/12/2010 3:55 am by YellowCircleWeb | Last modified 10/28/2010 6:01 am by Dave Buchholz | 1975 views | 6 replies |

YellowCircleWeb

After performing a search only the found records are showing on the results page

I'm using DataAssist to create a back-end admin system. My results page works correctly initially. If I do a search for some records the results page displays the found records correctly.

However, once I've carried out a search my results page will not list anything other than the records it found, what I mean is if I go into other areas of the system and then just click on the link to display the results page again (having not performed any additional searches) I only ever get the records it found through my initial search displaying, it's no longer possible for me to see all records. It's like the page has cached the search results and is only going to display them. The only way I've found to correct this is to log out of the admin system and then log back in again, which is obviously not how I want it to work.

I need the system to display all records again, not just the one(s) it found previously once the initial search has been completed.

I've attached a copy of my search page and my results page in the zip file. (hope I've explained myself correctly - its a little difficult to describe)

Attached Files
search-and-results-pages.zip
Sign in to reply to this post

Dave BuchholzBeta Tester

In you articles page replace the search code with the following:

php:
<?php

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

  //comparison list additions
  
$WADbSearch1->addComparisonFromEdit("ArticleID","S_ArticleID","AND","=",1);
  
$WADbSearch1->addComparisonFromEdit("Headline","S_Headline","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("Article","S_Article","AND","Includes",0);
  
$WADbSearch1->addComparisonFromEdit("DatePosted","S_DatePosted","AND","=",2);

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



The session variable that holds the search results will now only be triggered when the search button is pressed.

Sign in to reply to this post

YellowCircleWeb

Thank you Dave, I'll give that a go. Was it something that I had done causing this or is it a bug in DataAssist? If so I'll make sure to keep the code you provided to hand for future projects.

Sign in to reply to this post

Dave BuchholzBeta Tester

It's what I would call a Data Assist Feature :)

It used to drive me crazy till I found out how to stop it happening

Sign in to reply to this post

Dani Chankhour

another way to go about this is to update the link to your results page to be as follow:

results.php?Search_x=1

Sign in to reply to this post

YellowCircleWeb

Thanks Dave, that worked a treat. Much appreciated.

Sign in to reply to this post

Dave BuchholzBeta Tester

No worries, glad it helped you

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