help with foreach

Hello, someone please help with code: I get the following error:

Parse error: syntax error, unexpected 'endforeach' (T_ENDFOREACH) in C:\xampp\htdocs\invoice\apdueprt.php on line 58

[code]

[/code] [php]<?php //Print version //Set at what record to break at 25 records per page $BreakAT=25; $num=0; $pagenum = 1; $totdue=0; ?> [/php]
[php]<?php foreach($rows as $row): if($num % $BreakAT == 0) { if($num>0){ echo ''; echo '
'; $pagenum++; }
	echo date('m/d/y'); 
	echo " Page " . $pagenum;

?> [/php]
[code]

Accounts Payable Report




[php]<?php $totdue += $row['amtdue']; echo ' '; $num++; [b]endforeach; [/b] echo '
date days amt
recur? acct# creditor purpose due late due
' . $row['status'] . ' ' . $row['acctno'] . ' ' . $row['bname'] . ' ' . $row['purpose'] . ' ' . $row['duedate'] . ' ' . ($late > 120 ? 'pastdue' : $row['dayslate']) . ' ' . number_format($row['amtdue'], 2, '.', '') . '
Grand Total: ' . number_format($totdue, 2, '.', '') . '
'; } ?> [/php] [code]
[/code]

99% of the time, it is a missing bracket…

foreach (blah blah){
some code…
no-end-bracket…

Look at any nested ones, too…

Also, I do not know what this is: " endforeach; "
Isn’t that HTML BOLD tags inside a PHP program without an echo? Echo"[b]"; ???

Hope that helps!

Sponsor our Newsletter | Privacy Policy | Terms of Service