Hello.
I made a modification to the code to eliminate the push. The modification that I did make does bring me results but I'm not completely there.
Right now, my results appear as: if I have a customer with three tracking numbers, my table appears with a row of table headings and the first tracking number, then a second row with table headings and the second tracking number, and finally a third row of table headings and the third tracking number.
Is there a way to re-write my code to show the table headings once with the three tracking numbers underneath the headings?
Here's the modified code....
sub get_customer
{
my ($dbh, $track_ref, @track_ref) = @_;
$dbh = WebDB::connect ();
my $sth = $dbh->prepare ("SELECT * FROM Shipments WHERE customer_id =
+?");
$sth->execute($customer_id);
while (my @track_ref = $sth->fetchrow_array ()){
print table ({-border => 0},
Tr ({-align => "CENTER", -valign=>"TOP", -BGCOLOR=>"silver", -st
+yle=>"font-family: verdana; font-size: 10pt;"},
th ({-width=>"50"},("Customer ID")),
th ({-width=>"50"},("Carrier")),
th ({-width=>"90"},("Tracking Number"))
+
));
print table ({-border => 0},
Tr ({-valign=>"center", -style=>"font-family: verdana; font-size:
+10pt;"},
td ($track_ref[7]),
td ($track_ref[3]),
td ($track_ref[4])
));
}
print start_form (-action => "http://wwwapps.ups.com/tracking/tracking
+.cgi", -method => "POST"),
table (
Tr (
td ("UPS Tracking Number:"),
td (textfield (-name => "tracknum"))
),
),
submit (-name => "choice", -value => "Track"),
end_form ();
}
Thanks for your help.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.