Gossamer Forum
Home : Products : DBMan : Installation :

Field showing UID instead of its contents

Quote Reply
Field showing UID instead of its contents
Hi,
I have a problem with the fields getting mixed up:
in the definition of the database I have something like this:

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Nombre => [1, 'alpha', 40, 255, 1, '', ''],
ing_alco => [2, 'alpha', 40, 255, 1, '', ''],
ing_nalc => [3, 'alpha', 40, 255, 0, '', ''],
Preparacion => [4, 'alpha', '40x3', 500, 1, '', ''],
Date => [5, 'date', 12, 15, 1, &get_date, ''],
Validated => [6, 'alpha', 0, 3, 0, 'no', 'si|No'],
Tu_Nombre => [7, 'alpha', 40, 255, 1, '', ''],
Mail => [8, 'alpha', 40, 255, 0, 'http://', '^http://'],
Pais => [9, 'alpha', 40, 255, 1, '', ''],
Userid => [10, 'alpha', -2, 15, 0, '', '']
);

The problem is that when I try to print the variable Pais (means country in spanish) it prints the user id instead.
For example the records displayed say something like this:
Sent by Tu_nombre (works ok) from default (where it should say argentina)
I tried and read everything in the forum but I cant solve this.
My guess is that I made some stupid mistake here or in sub html_record_form or sub html_record (below) but I cant find anything wrong!!!


sub html_record {
(original stuff here)

print qq|
<TABLE WIDTH="475" CELLPADDING=2 CELLSPACING=0 BORDER=0 BGCOLOR="#DDDDDD">
<TR><td colspan="2" align="left" valign="TOP" bgcolor="#FFFF99"><$font><b>$rec{'Nombre'}</b></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color><b>Ingredientes:</b> </FONT></TD>
<TD VALIGN="TOP"><$font>$rec{'ing_alco'}<br>$rec{'ing_nalc'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color><b>Preparacion:</b></FONT></TD>
<TD VALIGN="TOP"><$font>$rec{'Preparacion'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Fecha:</FONT></TD>
<TD VALIGN="TOP"><$font>$rec{'Date'}</Font></TD></TR>
<TR><td colspan="2" align="left" valign="TOP"> <$font_color>Enviado por $rec{'Tu_Nombre'}, de $rec{'Pais'}</FONT><br></TD></TR>
</TABLE>
|;
}


sub html_record_form {
# unmodified stuff here

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"></TD>
<TD VALIGN="TOP" WIDTH="475"><input type="Hidden" name="ID" value="$rec{'ID'}"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Nombre: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Nombre" VALUE="$rec{'Nombre'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Alcohol: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="ing_alco" VALUE="$rec{'ing_alco'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>No Alcohol: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="ing_nalc" VALUE="$rec{'ing_nalc'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Preparacion:</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="Preparacion" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Preparacion'}</TEXTAREA></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Fecha:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Date" VALUE="$rec{'Date'}" SIZE="12" MAXLENGTH="12"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Enviado por: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Tu_Nombre" VALUE="$rec{'Tu_Nombre'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>E-Mail: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Mail" VALUE="$rec{'Mail'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Pais: </FONT></TD>
<TD VALIGN="TOP"><INPUT TYPE="TEXT" NAME="Pais" VALUE="$rec{'Pais'}" SIZE="12" MAXLENGTH="20"></TD></TR>
</TABLE>
|;
}


Please if anyone sees the mistake here let me know cause I went over this a thousend times w/o luck.
When I change things here I always delete the prior records and start again, because I found that if I add a new field the old records get mixed, can this have something to do with it (I had a 11 and 12 field that I deleted trying to solve this problem)
In that time the problem was in City and Pais worked fine, so I deleted City but the problem went to Pais (country).

Thanks
Quote Reply
Re: Field showing UID instead of its contents In reply to
My guess is that you didn't change the line

$auth_user_field = 9;

in the default.cfg file. Be sure you set it to your $auth_user_field to the field number where the userid is -- in the case you state below, it would be 10.

I hope this helps.



------------------
JPD
Quote Reply
Re: Field showing UID instead of its contents In reply to
Thank you!
I completely overlooked that...
Its solved now, thanks a lot