in reply to Re: Loop Question
in thread Loop Question
good. the die is a plus.$SqlStatement=$db->prepare("SELECT TransDate, TransPmtAmt FROM Cust_ac +t_da WHERE CustomerNumber = ? AND TransType = 'P'") or die "prepare f +a +iled: " . $db->errstr()."\n";
good. maybe a die here.$SqlStatement->execute($CustomerNumber);
good. this fixes the seemingly infinite loop that appeared in your first code.while ( @stuff = $SqlStatement->fetchrow() ) {
This is a problem, though. You go to all the trouble of preparing, executing and retrieving data, but where do you use it?# do things with @stuff $FormatTransDate = substr($TransDate, 0, 10); $FormatTransPmtAmt = sprintf("\$%.2f", $TransPmtAmt); print $FormatTransDate; print " "; print $FormatTransPmtAmt; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (boo) loop analysis
by quietone (Initiate) on Mar 22, 2001 at 00:38 UTC |