There's a whole bunch of problems here. Apart from those already mentioned, do you really mean to put each result into a seperate table with no </table> tag?

..... ## Rather then getting '$all_info' with one fetch, then getting a N_NU +M with a seperate fetch, do it all at once. ## (assuming you are using two tables). Now you can skip the sub all t +ogether. my $tablerows = ""; ## Build the table row data, then add it to print +.... my $sth = $dhb->prepare("SELECT a.product, b.number FROM tableA a, tab +leB b WHERE a.id = b.id"); ## or whatever $sth->execute(); $sth->bind_columns(\my($product,$number)); ## use bind_columns while ($sth->fetch()) { my $found = ($number) ? 'FOUND' : 'NOT FOUND'; $tablerows .= qq{<tr><td width="15">&nbsp;</td><td class="textgrey +b">$product</td><td class="textgreyb">$found</td></tr>\n}; } ## Using here-is print <<HTML; <table width="100%" border="0" cellspacing="0" cellpadding="0"> $tablerows </table> HTML ....

You might want to read up on HTML::Template, as suggested earlier, for another way to output out the HTML


In reply to Re: Sub routine processing issue, HELP!!!!! by nedals
in thread Sub routine processing issue, HELP!!!!! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.