Skip to main content
Inspiring
March 8, 2010
Answered

select statement refinement

  • March 8, 2010
  • 1 reply
  • 248 views

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

This topic has been closed for replies.
Correct answer David_Powers

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

1 reply

David_Powers
David_PowersCorrect answer
Inspiring
March 8, 2010

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