Skip to main content
January 29, 2010
Question

Not getting ANY results

  • January 29, 2010
  • 2 replies
  • 2971 views

For some reason I am not getting query results – cannot figure out why.

The idea here is to search a table with multiple words inputted from a form.

Depending on how many words, the code will creates additional WHERE conditions to find matches for each word.

Thus, if three would are inputted, it will create three WHERE statements and query the table for all three words then return the results.  If four words – then it will create four WHERE statement and query all four words and so on.

But, for some reason it is not returning any results and I can’t figure out why.

This topic has been closed for replies.

2 replies

David_Powers
Inspiring
January 30, 2010

Bregent's advice is spot on. Also, I don't know if you have seen the article I wrote about doing this a few months ago? See http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html.

January 30, 2010

Thanks - I tried printing out the results - but for some reason I am not getting any results - so nothing prints.  If I print out the input - it prints outs fine - just no results. I also wanted to echo any errors - but, no errors and no results - thus I have nothing to print out.

I will try to print the query.

Will also check out your article.

Participating Frequently
January 30, 2010

Insteading of submitting the query to the database, spit it out to the screen so you can see where the problem is. Post the output here if you can't find the problem in the sql.