Gossamer Forum
Home : Products : DBMan : Installation :

Search is not working

Quote Reply
Search is not working
I'm sure that I will end up kicking myself over this one, but I've carefully followed the installation instrucions, re-uploaded the files in ASCII, played with permissions, and yet I still cannot get the search to work.

Every term I enter returns a "no matching records," yet List All functions properly.

I checked the knowledge base and while helpful, did not find anything to solve my problem.

The link is http://www.hbdreb.on.ca/public/cgi-bin/db.cgi

Thanks, bill
Quote Reply
Re: [BillD] Search is not working In reply to
It's hard to tell what could be wrong by just trying out the search.

It's obvious it's ignoring the max hits to be displayed when searching as it will return all records.

I think to help solve the problem it would be necessary to post a text copy of both your .cfg and html.pl file. Please provide the url to where those files can be viewed.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Search is not working In reply to
Thanks LoisC

I've moved the .cfg and html.pl to www.hbdreb.on.ca/public/default.txt and www.hbdreb.on.ca/public/html.txt

I appreciate your efforts.

Bill
Quote Reply
Re: [BillD] Search is not working In reply to
I've noticed in your sub html_record you have:

$url{'Email:'} = $rec{'Email:'};
$url{'Email:'} =~ s/<\/?B>//g;
$url{'Website:'} = $rec{'Website:'};
$url{'Website:'} =~ s/<\/?B>//g;

You have extra colons added after the field names which could cause problems. You might want to change that to:

$url{'Email'} = $rec{'Email'};
$url{'Email'} =~ s/<\/?B>//g;
$url{'Website'} = $rec{'Website'};
$url{'Website'} =~ s/<\/?B>//g;

Since you are not using the references above you might want to turn off bolding in your .cfg file. Having bold turn on does tend to cause problems under certain circumstances.

$db_bold = 1;

or use the field values for email and website as:

if ($rec{'Email'}) { print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Email:</FONT></TD>
<TD WIDTH="80%">&nbsp;<$font>$url{'Email'}</Font></TD></TR> |;
}
if ($rec{'Website'}) { print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Website:</FONT></TD>
<TD WIDTH="80%">&nbsp;<$font>$url{'Website'}</Font></TD></TR> |;
}

It's still funny that the search form is not recognizing your $font variable?

Can you make those changes and see if it makes a difference.

If not, could you state what other changes you made to your html.pl file?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Search is not working In reply to
Just a quick tip...to save escaping forward slashes in regexes (and to make it easier to read) you can change the delimiters....

$url{'Website'} =~ s|</?B>||ig;

Notice the "i" too otherwise <b> and </b> will get ignored.
Quote Reply
Re: [LoisC] Search is not working In reply to
I made the changes, and it doesn't really seem to make much of a difference. Regarding the $font variable, I removed that as well with no noticeable affect either way (I have replaced the original files in the same link as above).

One other oddity is that the Reset Form button does not seem to function.

I really haven't changed much of the html.pl, in fact, I wasn't going to do any modifications to it until I had the script working properly. However, that being said, I used JPDeni's Configurator to create that page. I'm beginning to wonder if I should just redo the html.pl from scratch.

thanks again for your efforts.

bill
Quote Reply
Re: [BillD] Search is not working In reply to
This could be something really simple that is causing the problem.

It could be a matter of a missing " somewhere

In your sub html_record_form try defining your font tags like this (to include all quotes). You also only need to define these within your .cfg file and not within each sub.

my $font = 'Font face="Verdana, Arial, Helvetica" Size="2" Color="#003399"';

Perhaps you could just use a new copy of the html.pl file and plug in your html_record and html_add_form sub in again.

After you said the reset button didn't work I viewed the source of the page and my validation program states:

Missing </font> in this line

<tr><td colspan=2 bgcolor="navy"><FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF"><b>Regional Commercial Council Roster: Search the Database</b></td></tr>

Not sure that would cause the problem, but worth fixing regardless.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Search is not working In reply to
I've gone over the cfg, cgi and html and couldn't see anything suspect. What I ended up doing, is redownloading the original dbman files, and then posting them to our server. Everything works fine on the demo, so we know I must have screwed something up on my end.

Now I will work through the demo and manually adjust fields, to see if I get it to work.

I'll let you know how it goes, and thanks again for your help.

bill
Quote Reply
Re: [BillD] Search is not working In reply to
Well, we all knew the cause of my aggravation was going to be something frustratingly simple when discovered. While the problems kindly pointed out by Lois no doubt contributed, eventually through the process of elimination, I believe that most of my problems were due to the formatting in the database file (it got to the point where I had checked everything else). Nothing major, just enough not to work.

Now things are working, it will be time to start adding mods and changing formats.

Thanks for the help, and I guess we can chalk this one up to another lesson learned.

bill
Quote Reply
Re: [BillD] Search is not working In reply to
MadI'm now having the same problem as Bill. My search combinations just don't work! Again, getting very very frustrated. I've had so much help here already and just when I think I have it all together (I swear I checked this script before I left town last week and it was working fine) something else goes wrong. I tried to follow the suggestions Lois gave Bill but those changes didn't make the searches work. I suppose I could have accidentally changed something after I tested but I'm not sure what it could have been. Can anyone help? My files are posted at http://www.ebr.lib.la.us/html_pl.txt and http://www.ebr.lib.la.us/default_cfg.txt.

Thanks so much for any help anyone can give.



Elizabeth
Quote Reply
Re: [ebm76] Search is not working In reply to
Bill's solution was checking and fixing a problem with the database file. Did you check over your database file for the latest entries and see if it could have become corrupted?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Search is not working In reply to
Lois,

I recreated the db file and the count file...still no go. I'm going to keep looking...there has to be a logical reason ;)



Elizabeth
Quote Reply
Re: [ebm76] Search is not working In reply to
It's working! :) I looked and looked and finally saw....

I took the last copy of html.pl I had that I knew had worked and the current copy and used the diff command and directed the results into a new text file. When I printed that file out, I saw that for two different sets of input I had values written like

VALUE="Userid"

instead of

VALUE="$rec{'Userid'}"

Lois, thanks for your inspiration and encouragement. :)

Elizabeth