Solved

database results refresh problem

Posted on 1998-08-04
13
127 Views
Last Modified: 2013-12-25
I have a search form which returns records from a  database. If I refresh the results page the criteria for the search are lost and the page displays every record in the database. Any fixes on this one?
NM
0
Comment
Question by:englishman
  • 7
  • 2
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:davejenkins
ID: 1858820
How is the page being built?  With a CGI script?  Are you POSTing or GETting the data?  Please give us some more info . . .
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1858821
Save the search criteria in hiden fields and when you refresh the page, pass those hidden fields back as parameters.

<INPUT TYPE=HIDDEN NAME=Param1 VALUE="search text1">
etc...

- Matt
0
 
LVL 2

Author Comment

by:englishman
ID: 1858822
Hi,
searchform includes:

<form method="POST" action="librarysearch.asp">
  <p><strong>Keywords:</strong> <input type="text" name="KeywordEntry" size="20"></p>
  <p><strong>And:</strong> <input type="text" name="KeywordEntry1" size="20"></p>
  <p><br>
  <input type="submit" value="Search" name="B1" style="color: rgb(0,128,128)"><input
  type="reset" value="Reset" name="B2"></p>


answer page includes:

 <!--webbot bot="DatabaseRegionStart" startspan s-columnnames="Authors,Date,Keywords"
  s-connstring="DSN=crtintlib" b-tableformat="TRUE"
  s-sql="SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
  local_preview="&lt;tr&gt;&lt;td colspan=6 bgcolor=&quot;#FFFF00&quot; align=&quot;center&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; Database Regions do not preview unless this page is fetched from a Web server using a web browser.  The following table will display one row for each query result row when the page is fetched from a Web server.&lt;/td&gt;&lt;/tr&gt;"
  preview clientside s-DefaultFields s-NoRecordsFound="No Records Returned" i-MaxRecords
  i-ScriptTimeout tag="BODY" s-Password --><%
' Substitute in form parameters into the query string
fp_sQry = "SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
fp_sDefault = ""
fp_sNoRecords = "No Records Returned"
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 2

Author Comment

by:englishman
ID: 1858823
Hi,
searchform includes:

<form method="POST" action="librarysearch.asp">
  <p><strong>Keywords:</strong> <input type="text" name="KeywordEntry" size="20"></p>
  <p><strong>And:</strong> <input type="text" name="KeywordEntry1" size="20"></p>
  <p><br>
  <input type="submit" value="Search" name="B1" style="color: rgb(0,128,128)"><input
  type="reset" value="Reset" name="B2"></p>


answer page includes:

 <!--webbot bot="DatabaseRegionStart" startspan s-columnnames="Authors,Date,Keywords"
  s-connstring="DSN=crtintlib" b-tableformat="TRUE"
  s-sql="SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
  local_preview="&lt;tr&gt;&lt;td colspan=6 bgcolor=&quot;#FFFF00&quot; align=&quot;center&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; Database Regions do not preview unless this page is fetched from a Web server using a web browser.  The following table will display one row for each query result row when the page is fetched from a Web server.&lt;/td&gt;&lt;/tr&gt;"
  preview clientside s-DefaultFields s-NoRecordsFound="No Records Returned" i-MaxRecords
  i-ScriptTimeout tag="BODY" s-Password --><%
' Substitute in form parameters into the query string
fp_sQry = "SELECT Keywords, Authors, Date FROM library WHERE (library.Keywords like  '%%%KeywordEntry%%%' AND library.Keywords   like  '%%%KeywordEntry1%%%')"
fp_sDefault = ""
fp_sNoRecords = "No Records Returned"
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1

0
 
LVL 2

Author Comment

by:englishman
ID: 1858824
Frontpage as you see, sorry about 2*post

0
 
LVL 37

Expert Comment

by:bbao
ID: 1858825
Does the URL line of your browser contain all the search conditions while you perform a searching?
0
 
LVL 2

Author Comment

by:englishman
ID: 1858826
no search conditions in the URL
0
 
LVL 2

Expert Comment

by:Wiz_of_Oz
ID: 1858827
what technology r u using to access the db?
0
 
LVL 2

Author Comment

by:englishman
ID: 1858828
asp frontpage sql
0
 
LVL 37

Expert Comment

by:bbao
ID: 1858829
Since no search conditions in the URL, so as you refresh the content, browser send same URL to server again, the server cannot do same searching with proper conditions you want, then the result cannot be given as you like.
0
 
LVL 10

Accepted Solution

by:
MasseyM earned 30 total points
ID: 1858830
Why did you reject my answer from before?

0
 
LVL 2

Author Comment

by:englishman
ID: 1858831
Sorry Matt, I thought I'd got locked into talk with someone who said I couldn't do it.
Your answer is what I'm looking for.
Unfortunately I am new to coding and need to be a little more spoon fed.
How do I do this? -
NM

0
 
LVL 2

Author Comment

by:englishman
ID: 1858832
Sorry Matt, I thought I'd got locked into talk with someone who said I couldn't do it.
      Your answer is what I'm looking for.
      Unfortunately I am new to coding and need to be a little more spoon fed.
      How do I do this? -
      NM
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question