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

select statement refinement

Participant ,
Mar 08, 2010 Mar 08, 2010

Copy link to clipboard

Copied

I have 3 textboxes to which people can search.

$query_findComp = "SELECT user_id, company_name, comp_add1, comp_add2, comp_add3, comp_city, comp_postcode, comp_tel, comp_fax, comp_email, comp_web, comp_description, honors_awards, industry, listed_in_bd, logo FROM users WHERE company_name LIKE '%$_GET[company]%' OR industry = '$_GET[industry]' OR comp_city = '$_GET[location]' ";

I want to be able to remove/ not send info for the blank textboxes to the query so that the search is more relevant.

Currently it will output everything.

How would I go about making this?

Thanks

TOPICS
Server side applications

Views

224
Translate

Report

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

correct answers 1 Correct answer

LEGEND , Mar 08, 2010 Mar 08, 2010

http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html

Votes

Translate
LEGEND ,
Mar 08, 2010 Mar 08, 2010

Copy link to clipboard

Copied

LATEST

http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html

Votes

Translate

Report

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