Gossamer Forum
Home : Products : DBMan : Installation :

Searching Error

Quote Reply
Searching Error
I can do a key word search but can not get the form to do a search on a particular entry. Can someone help me figure out what's going wrong. Even if I copy and paste it just puts ~~ in one of the fields and says that it can find no matches.

Please let me know what information you need to help me out. I've almost got this one part done and this is the last I have to work on to get the database running good.
Quote Reply
Re: [GCSHC] Searching Error In reply to
Can you provide the url so we can check it out.

Also it may help to provide the code being used for the search form. If it's the keyword search then copy the sub html_search_options for us to check out.

Also make sure you have the fields in your .cfg file set up as numbered from 0 to whatever. It could be that perhaps you are missing a number ??? Just a wild guess.

Does everything else work correctly?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Searching Error In reply to
http://www.gcshc.com/cgi-bin/registry/db.cgi

There's the html.pl file, I've changed the look of how the form appears and that was all I have changed on the html file.

Code:

sub html_record_form {
# --------------------------------------------------------
# The form fields that will be displayed each time a record is
# edited (including searching). You don't want to put the
# <FORM> and </FORM tags, merely the <INPUT> tags for each field.
# The values to be displayed are in %rec and should be incorporated
# into your form. You can use &build_select_field, &build_checkbox_field
# and &build_radio_field to generate the respective input boxes. Text and
# Textarea inputs can be inserted as is. If you turn on form auto
# generation, the program will build the forms for you (all though they may
# not be as nice). See the README for more info.
my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#000066';
print qq|
<TABLE WIDTH="50%" CELLPADDING=1 CELLSPACING=2 BORDER=0 BGCOLOR="#000066">
<TR><TD ALIGN="Left" VALIGN="Center" WIDTH="25%"><Font COLOR="#FFFFFF" SIZE="-1"><B>GCID #</B></FONT>
<INPUT TYPE="TEXT" NAME="GCID" VALUE="$rec{'GCID'}" SIZE="6" MAXLENGTH="8"></TD>
<TD ALIGN="Right" VALIGN="Center"><Font COLOR="#FFFFFF" SIZE="-1"><b>&nbspType:</b></FONT>
&nbsp;|; print &build_select_field ("Type", "$rec{'Type'}"); print qq|></TD></TR>
<TR><TD ALIGN="Left" VALIGN="Center" WIDTH="25%" BGCOLOR="#FFFFFF"><$font>Registered By: </FONT>
<BR><INPUT TYPE="TEXT" NAME="RegisteredBy" VALUE="$rec{'RegisteredBy'}" SIZE="25" MAXLENGTH="255"><BR><BR>
<$font>Boarding : </FONT>
<BR><INPUT TYPE="TEXT" NAME="Boarding" VALUE="$rec{'Boarding'}" SIZE="25" MAXLENGTH="255"><BR><BR>
<$font>Owner : </FONT>
<BR><INPUT TYPE="TEXT" NAME="Owner" VALUE="$rec{'Owner'}" SIZE="25" MAXLENGTH="255"><BR><BR>
<$font>Breeder : </FONT>
<BR><INPUT TYPE="TEXT" NAME="Breeder" VALUE="$rec{'Breeder'}" SIZE="25" MAXLENGTH="255"><BR><BR>
|;
if ($per_admin) {
print qq|
<$font>Genetics : <br></FONT>
<TEXTAREA NAME="Awards" ROWS="2" COLS="20" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Genetics'}</TEXTAREA><br><br></TR>
|;
}

else {
print qq|
<input type="hidden" NAME="Genetics" VALUE="$rec{'Genetics'}">
|;
}
print qq|
<TD ALIGN="Center" VALIGN="Top" BGCOLOR="#FFFFFF"><$font><b><INPUT TYPE="TEXT" NAME="Name" VALUE="$rec{'Name'}" SIZE="18" MAXLENGTH="18"></b></FONT><BR>

<$font><INPUT TYPE="TEXT" NAME="Year" VALUE="$rec{'Year'}"SIZE="5" MAXLENGTH="7">&nbsp<INPUT TYPE="TEXT" NAME="Color" VALUE="$rec{'Color'}">&nbsp<INPUT TYPE="TEXT" NAME="Breed" VALUE="$rec{'Breed'}">&nbsp;|; print &build_select_field ("Gender", "$rec{'Gender'}"); print qq|</FONT><BR>

<FONT COLOR="#660000"><INPUT TYPE="TEXT" NAME="Sire" VALUE="$rec{'Sire'}" SIZE="25" MAXLENGTH="255">&nbsp <I><B>X</B></I>&nbsp <INPUT TYPE="TEXT" NAME="Dam" VALUE="$rec{'Dam'}" SIZE="25" MAXLENGTH="255">
<BR><BR>
<$font>Trained In : <br></FONT>
<TEXTAREA NAME="TrainedIn" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'TrainedIn'}</TEXTAREA><br><br>
<$font>Awards : <br></FONT>
<TEXTAREA NAME="Awards" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Awards'}</TEXTAREA><br><br></TD></TR></TD></TR>
</TABLE>
|;
}
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

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

print qq|
<TABLE WIDTH="50%" CELLPADDING=1 CELLSPACING=2 BORDER=0 BGCOLOR="#000066">
<TR><TD ALIGN="Left" VALIGN="Center" WIDTH="25%"><Font COLOR="#FFFFFF" SIZE="-1"><b>&nbsp#</b></FONT>
<FONT COLOR=#FFFFFF><b>$rec{'GCID'}</Font></TD>
<TD ALIGN="Right" VALIGN="Center">
<FONT COLOR=#FFFFFF><b>$rec{'Type'}</Font></TD></TR>
<TR><TD ALIGN="Left" VALIGN="Center" WIDTH="25%" BGCOLOR="#FFFFFF"><$font>Registered By: </FONT>
<BR><$font>$rec{'RegisteredBy'}</Font><BR><BR>
<$font>Boarding : </FONT>
<BR><$font>$rec{'Boarding'}</Font><BR><BR>
<$font>Owner : </FONT>
<BR><$font>$rec{'Owner'}</Font><BR><BR>
<$font>Breeder : </FONT>
<BR><$font>$rec{'Breeder'}</Font><BR><BR>
|;
if ($per_admin) {
print qq|
<$font>Genetics : </FONT>
<BR><$font>$rec{'Genetics'}</Font></TD>
|;

}
else {
print qq|
<input type="hidden" NAME="Genetics" VALUE="$rec{'Genetics'}">
|;
}
print qq|
<TD ALIGN="Center" VALIGN="Top" BGCOLOR="#FFFFFF"><$font><b><$font>$rec{'Name'}</Font></b></FONT><BR>

<$font><$font>$rec{'Year'}</Font>&nbsp<$font>$rec{'Color'}</Font>&nbsp<$font>$rec{'Breed'}</Font>&nbsp<$font>$rec{'Gender'}</Font><BR>

<FONT COLOR="#660000"><$font><i>$rec{'Sire'}</i></Font>&nbsp <I><B>X</B></I>&nbsp <$font><i>$rec{'Dam'}</i></Font>
<BR><BR>
<$font>Trained In : <br></FONT>
<$font>$rec{'TrainedIn'}</Font><br><br>
<$font>Awards : <br></FONT>
<$font>$rec{'Awards'}</Font><br><br></TD></TR></TD></TR>
</TABLE>
|;
}

Last edited by:

LoisC: Apr 25, 2004, 2:25 AM
Quote Reply
Re: [GCSHC] Searching Error In reply to
Since you haven't modified the search form I'm guessing that perhaps the following errors within your sub html_record_form may be causing you problems.

<TD ALIGN="Right" VALIGN="Center"><Font COLOR="#FFFFFF" SIZE="-1"><b>&nbspType:</b></FONT>
&nbsp;|; print &build_select_field ("Type", "$rec{'Type'}"); print qq|></TD></TR>

change to (removing extra > before </TD>

<TD ALIGN="Right" VALIGN="Center"><Font COLOR="#FFFFFF" SIZE="-1"><b>&nbspType:</b></FONT>
&nbsp;|; print &build_select_field ("Type", "$rec{'Type'}"); print qq|></TD></TR>


Change:

<$font>Genetics : <br></FONT>
<TEXTAREA NAME="Awards" ROWS="2" COLS="20" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Genetics'}</TEXTAREA><br><br></TR>

To:
<$font>Genetics : <br></FONT>
<TEXTAREA NAME="Genetics" ROWS="2" COLS="20" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Genetics'}</TEXTAREA><br><br></TR>

before the ending table tag remove the extra </TD></TR>

Let us know if that fixes the problem with the search.

Rather than posting the complete html.pl file it's best to either post a text copy on your server and provide a url to where it can be viewed, or attach a copy to your post.
This makes it less confusing when searching the forums as people won't get the unrelated results due to entire files being within the posts.

I'm going to go ahead and remove the sub from your post. If you need further help, please use on of the above options :) Or provide a url to where your database can be viewed. Sometimes just looking at the source code of pages helps to spot html errors.

I didn't realize till I edited your message that you did provide the url .. it was hiding from view. When viewing the source of your search page I also noticed you have several instances of

&nbsp instead of &nbsp;

You may want to check your coding in sub html_record.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/

Last edited by:

LoisC: Apr 25, 2004, 2:28 AM
Quote Reply
Re: [LoisC] Searching Error In reply to
Thank you that worked. I'm sorry it took so long to test it.