Gossamer Forum
Home : Products : DBMan : Customization :

Short/long mod error - Links to wrong result

Quote Reply
Short/long mod error - Links to wrong result
Hello all. this is my first post on this board and my first attempt at using Dbman. I'd been searching for some time to see if i could find the answers on here but no luck. I think my problem is pretty easy to fix so here goes.

I used the short/long mod from jp deni, and it all works fine apart from the linking from the short to long results. The links go to the result just above the one you click on. The key field is "name" and I was thinking that may be the problem. Below are links to the cfg - pl and cgi files.

http://www.parkenglish.com/files/html.txt
http://www.parkenglish.com/files/default.cfg.txt
http://www.parkenglish.com/files/db.txt

Also you can see the error at http://parkenglish.com/cgi-bin/dbase/db.cgi (default logins apply)

Let me know what you guys come up with. thanks!!!
Quote Reply
Re: [royalblak] Short/long mod error - Links to wrong result In reply to
Using Name as ID may not be a good idea unless you can guarantee no two records will have the same. In other words you can't have two "Charles".

Check your default.db for some kind of duplicate or other whackiness.

Do a list all and put your mouse over albert - notice he is nh=0. However when you click on albert and put your mouse over the "next" link it's pulling up nh=2 (instead of nh=1). This tells me something is screwy with the db file.
Quote Reply
Re: [Watts] Short/long mod error - Links to wrong result In reply to
thanks for the heads up. for now i think i got it working. I'm not sure if this is the best way to do it but I can move forward for now. cheers!

I had to change the following line

# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $rec_count);


I added + 1 to the value and it seems to return the correct result now.

# create link to full display
$record_number = (((($nh - 1) * $db_max_hits) + $rec_count) + 1 );

Quote Reply
Re: [royalblak] Short/long mod error - Links to wrong result In reply to
I think rather than tweaking the line you did to get it to work, you should perhaps find out why it's not working and make whatever corrections necessary.

I would start with turning off in your .cfg file:

$db_key_track = 0;

since this may be looking for an ID field.

You can also condense this section of your sub html_record_form:

|;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="250"><$font_color>Comments:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;<TEXTAREA NAME="Comments" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="1000">$rec{'Comments'}</TEXTAREA></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="250"><$font_color>Sex:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"><$font>&nbsp;|; print &build_radio_field("Sex",$rec{'Sex'}); print qq|</font</TD></TR>
|;
}
else {
print qq| <input type="hidden" NAME="Comments" VALUE="$rec{'Comments'}">
<input type="hidden" NAME="Sex" VALUE="$rec{'Sex'}"> |;
}

Unoffical DBMan FAQ

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

Last edited by:

LoisC: Feb 2, 2004, 12:02 AM