Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Easy MySQL data filtering question

Guest
Feb 21, 2010 Feb 21, 2010

I've got a pretty dumb question.

When creating a search query (in DW CS4), how do I specify that if a field is submitted blank, the DB should return all results?

As in, maybe I want to find all people who live in a certain city - I would choose the city in the search form, but I would leave "name" blank, because I don't want to limit by name. So how do I tell it to not try to match blank fields and instead return all?

Thanks in advance.

+mf

TOPICS
Server side applications
297
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 21, 2010 Feb 21, 2010

Anyone? Anything?  I figured this would be an easy one.

I've got the following form fields to search the corresponding columns:

  • Company (can be = as form field is dynamically generated with available values)
  • Contact Name (same as above)
  • Phone (varchar) using LIKE
  • Payment Status (int) 1,0
  • Sponsor (varchar) can use = as all data was entered using pre-populated drop-down menus.
  • Amount Paid (varchar) uses drop-down consisting of ranges (0-99, 100-499, 500-999, 1000-4999, 5000-9999, 10000+)
  • Golfer's Name: This is a text field that needs to search 4 different db columns (golfer_1, golfer_2, golfer_3, golfer_4)

So that's what I'm working with and I could REALLY use some help... I've never quite gotten the hang of this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 21, 2010 Feb 21, 2010
LATEST

It's not quite as simple as you would like to think. However, the following article in the Dreamweaver Cookbook might help: http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines