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"

Recommended Answers

All 2 Replies

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!

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.