Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hey, I left this program alone for a while and now i'm working on it again. I'm trying to view the first 100 records from a database and then display the next 100 and so on. I'm able to display the first 100 but i don't know how to show the next 100. This is the section of my program that's supposed to do this: my ($row)=0; my ($count)=0; my ($min)=0; my ($max)=$min+100; while ($db->FetchRow()) { if(($row>=$min)&&($row<$max)) { my (%dbrow) = $db->DataHash(); $dbrow{'details'}=substr($dbrow{'details'},0,50); print<<HERE_HTML_ROW; <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'la +stname'},&nbsp;$dbrow{'firstname'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'of +ficephonenumber'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'de +scription'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$company_t +ype&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'co +mpany_name'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'de +tails'}&nbsp;</font>&nbsp;</td> HERE_HTML_ROW print "\n</tr>\n"; } $row++; $count++; } print "\n</table>\n"; my ($visible); if ($count>=$max){ $visible=$max; } else { $visible=$count; } print<<HERE_HTML; <BR><font size="2" face="helvetica"><B>1-$visible of $count records di +splayed</B></font> HERE_HTML # This is the part that's not working because i don't think # that i can do this, please help. if ($row>$max) { print "<font size=2 face=helvetica><a href=\"$ENV{'SCRIPT_NAME'}?$ +ENV{'QUERY_STRING'}&min=100\">Next 100</a></font>\n"; } Thanks, Kiko

In reply to Viewing by Kiko

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2021-11-30 14:31 GMT
Find Nodes?
    Voting Booth?

    No recent polls found