954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

force Search Page to return no records on open

I have a page that is primarily designed to search the database for all entries within the entered state.

I'd like to open the page with no results being returned in the results form. Currently when the page is loaded it returns all the records in the db.

Here is the select statement:
"SELECT * FROM National WHERE (State like '%::SearchValue::%') ORDER BY State ASC"

ymcapa
Newbie Poster
2 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 

So you want a query that returns zero results? If so, does that SQL statement have to remain unmodified? Please be a tad clearer. Thanks!

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 
So you want a query that returns zero results? If so, does that SQL statement have to remain unmodified? Please be a tad clearer. Thanks!

I wanted the results to be empty when the user first loads the page so that they can then search for the info they desire. I solved the problem in the hyperlink instead of the SQL statement by adding "?searchvalue=ST" to the end of the url.

Since no state has the abbreviation "ST" this returns empty results on load.

here is the page in question if you want to look: www.ymcayg.org

ymcapa
Newbie Poster
2 posts since May 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You