propzmgmt Posted November 20, 2022 Share Posted November 20, 2022 Quote Hi, can someone advise me as to why I get this error? thanks <!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"> <head></head><body><center> <div class="display print"> <?php //Open a new connection to the MySQL server $link = mysqli_connect("localhost", "root", "", "homedb"); // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } echo date('m/d/y'); //MySqli Select Query $sql = "select * FROM paytbl"; $result = mysqli_query($link,$sql); if (!$result) { printf("Error: %s\n", mysqli_error($link)); exit(); }else{ while($row = mysqli_fetch_array($result)){ //Set at what record to break at 25 records per page $BreakAT=25; $pagenum = 0; echo date('m/d/y'); ?> <b> <div class="title"><h3>Payment Report</h3></div><br /> <table align="center" cellspacing=5 cellpadding=5 border=2> <thead> <tr> <th colspan=2> </th> <th bgcolor="cyan" colspan=2>Rent</th> <th bgcolor="99FF99">Prev</th> <th bgcolor="FF99FF">late</th> <th bgcolor="99FF99">sec</th> <th></th> <th bgcolor="99FF99">court</th> <th></th> <th bgcolor="99FF99">hud</th> <th>Date</th> <th colspan=2></th> <tr> <th>Tenant</th> <th>Unit</th> <th bgcolor="cyan">Due</th> <th bgcolor="cyan">Paid</th> <th bgcolor="99FF99">Bal</th> <th bgcolor="FF99FF">chg</th> <th bgcolor="99FF99">dep</th> <th bgcolor="FF99FF">damage</th> <th bgcolor="99FF99">cost</th> <th bgcolor="FF99FF">nsf</th> <th bgcolor="99FF99">pay</th> <th>Paid</th> <th bgcolor="cyan">Paidsum</th> <th>Comments</th> </tr> </thead> <?php $slice= array_slice($results,((($pagenum + 1) * $BreakAT) - $BreakAT), (($pagenum + 1)* $BreakAT)); foreach($slice as $row){ echo ' <tr> <td>' . $row['tenant'] . '</td> <td>' . $row['unit'] . '</td> <td align=right class="currency">$'.number_format($row['amtdue'],2).'</td> <td align=right class="currency">$'.number_format($row['amtpaid'],2).'</td> <td align=right class="currency">$'.number_format($row['prevbal'],2).'</td> <td align=right class="currency">$'.number_format($row['latechg'],2).'</td> <td align=right class="currency">$'.number_format($row['secdep'],2).'</td> <td align=right class="currency">$'.number_format($row['damage'],2).'</td> <td align=right class="currency">$'.number_format($row['courtcost'],2).'</td> <td align=right class="currency">$'.number_format($row['nsf'],2).'</td> <td align=right class="currency">$'.number_format($row['hudpay'],2).'</td> <td>' . $row['datepaid'] . '</td> <td align=right class="currency">$'.number_format($row['paidsum'],2).'</td> <td>' . $row['comments'] . '</td> </tr>'; } echo ' <tr> <td colspan=2></td> <td bgcolor="cyan" align=right>' . array_sum(array_column($slice, 'amtdue')) . '</td> <td bgcolor="cyan" align=right>' . array_sum(array_column($slice, 'amtpaid')) . '</td> <td bgcolor="99FF99" align=right>' . array_sum(array_column($slice, 'prevbal')) . '</td> <td bgcolor="FF99FF" align=right>' . array_sum(array_column($slice, 'latechg')) . '</td> <td bgcolor="99FF99" align=right>' . array_sum(array_column($slice, 'secdep')) . '</td> <td bgcolor="FF99FF" align=right>' . array_sum(array_column($slice, 'damage')) . '</td> <td bgcolor="99FF99" align=right>' . array_sum(array_column($slice, 'courtcost')) . '</td> <td bgcolor="FF99FF" align=right>' . array_sum(array_column($slice, 'nsf')) . '</td> <td bgcolor="99FF99" align=right>' . array_sum(array_column($slice, 'hudpay')) . '</td> <td bgcolor="cyan" align=right>' . array_sum(array_column($slice, 'paidsum')) . '</td>' } ?> </table class="print"> <div class="breakhere"></div> </b></center></div></body></html> Quote result: Parse error: syntax error, unexpected '}', expecting ';' or ',' Quote Link to comment https://forums.phpfreaks.com/topic/315565-need-help-wpagination/ Share on other sites More sharing options...
Barand Posted November 20, 2022 Share Posted November 20, 2022 The error message would have told which line the error was on. Perhaps you could tell us? Quote Link to comment https://forums.phpfreaks.com/topic/315565-need-help-wpagination/#findComment-1602804 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.