Gossamer Forum
Home : Products : DBMan : Installation :

Failed search problem

Quote Reply
Failed search problem
Hi. When doing a search using a keyword, if the word is found in the database, all is fine and the record comes up.

But, if the keyword isn't found, the keyword ends up being displayed in all the fields that don't use the "build select field" option on the failed search screen.

Any ideas what to look for?

Thanks
Quote Reply
Re: Failed search problem In reply to
That's how the script works. It sets the value of all the fields to equal the keyword in order to have the search on all fields.

I just had a thought that might work. At the beginning of sub html_view_failure, add

Code:
if ($in{'keyword'}) {
undef %in;
}

That will prevent this from happening. I think. Smile



------------------
JPD





Quote Reply
Re: Failed search problem In reply to
Worked like a charm! Thanks. This was the first time I tested the keyword search for a word I knew wasn't there to see what happened. Thought I messed up one of the files again Smile

One thing, what does the code actually do, I think I know, but .....? Learning curve again.

Thanks again.
Quote Reply
Re: Failed search problem In reply to
The code that inserts the previous search terms into the form after a failed search is

&html_record_form(%in);

The %in hash holds everything that was input by the previous form or was changed by the script between the clicking of the previous submit button and the displaying of the new form.

The line

undef %in

makes the %in hash completely blank. Erases it like it never existed. So when the line

&html_record_form(%in);

is executed, nothing is sent to the form, so your fields are blank.


------------------
JPD





Quote Reply
Re: Failed search problem In reply to
Thanks, makes more sense now.

Have a nice weekend,

spike