88f615f6 Posted May 6, 2014 Share Posted May 6, 2014 Hi, Someone please tell me how to resolve this issue ? following is error derived frommy code which then follows: Notice: Undefined variable: rows in C:\xampp\htdocs\invoice\apdueprnt.php on line 62Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\invoice\apdueprnt.php on line 62 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" ><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="en" /> <meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0" /> <link type="text/css" rel="stylesheet" href="print.css" media="print" /> <title> Accounts Payable Demo </title> </head><body> <table class="accountsPayable"> <caption> Accounts Payable Report </caption><thead> <tr> <th>recur?</th> <th>acct#</th> <th>creditor</th> <th>purpose</th> <th>due</th> <th>late</th> <th>due</th> </tr> </thead><tfoot> <tr> <td colspan="3">', date('m/d/y'), '</td> <td colspan="4" class="page"></td> </tr> </tfoot><tbody> <?php $totalDue = 0; // ********************************************** foreach ($rows as $row) { $totalDue += $row['amtdue']; echo ' <tr> <td>', $row['status'], '</td> <td>', $row['acctno'], '</td> <td>', $row['bname'], '</td> <td>', $row['purpose'], '</td> <td>', $row['duedate'], '</td> <td class="currency">', ($row['dayslate'] > 120 ? 'pastdue' : $row['dayslate']), '</td> <td class="currency">', number_format($row['amtdue'], 2, '.', ''), '</td> </tr>'; } echo ' <tr class="grandTotal"> <th scope="row" colspan="6">Grand Total:</th> <td class="currency">', number_format($totalDue, 2, '.', ''), '</td> </tr>'; ?> </tbody> </table> </body></html> Quote Link to comment Share on other sites More sharing options...
trq Posted May 6, 2014 Share Posted May 6, 2014 It's pretty self explanatory, $rows isn't defined anywhere in your code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.