Gossamer Forum
Home : Products : DBMan : Installation :

Showing records in my own table

Quote Reply
Showing records in my own table
Sorry, I know my question is very stupid but I am very new in cgi...
So I want to change the way my records look in the browser. I have read the tutorials but I still got the problem: it didn't change the tables.

see this part of the html.pl: (auto generate is on.

my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

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

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">

</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=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

print qq|
<table border="0" width="410" cellspacing="1" bgcolor="#000000" cellpadding="3">
<tr><td align="center" colspan="2" bgcolor="#F0F0F0">
<$font_color>ID:</FONT> <$font>$rec{'Date'}</Font> <$font>$rec{'Date'}</Font></td></t r>
<tr><td align="center" colspan="2" bgcolor="#F0F0F0">
<$font>$rec{'Name'}</Font> <$font>$rec{'Email'}</Font></td></tr>
<tr><td align="center" colspan="2" bgcolor="#EDE9D8">
<b> <$font>$rec{'Model'}</Font></b></td></tr>
<tr><td align="center" width="50%" bgcolor="#F0F0F0">
<$font_color>употребявано</FONT> <$font>$rec{'Used'}</Font></td>
<TD align="center" width="50%" bgcolor="#F0F0F0">
<$font_color>Цена:</FONT> <$font>$rec{'Price'}</Font></td></tr>
</table>
|;
}


Do I have any mistakes in the code above?
Is the problem that auto generate is on?
Should I make manually the form fields before I try to use my new tables?
Excuse me for the stupid questions but I just don't know what should I do.
And thank you in advice!
Quote Reply
Re: Showing records in my own table In reply to
I saw your problem right off:

Code:
($db_auto_generate and print &build_html_record(%rec) and return);

When you get your own form created, you can then turn off autogenerate or remove the similar line from sub html_record_form.


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