这是我的错误-它一定是我忽略了的东西,不确定它在哪里。
分析错误:语法错误,第107行的/home/mjcrawle/public_html/cit0215/assignment5/onlinebanking/viewaccounts.php中存在意外的$end
问候
<?php
require_once('footer_nav/navigation.inc.php');
require_once('../websiteconfig.inc.php');
require_once('/class/person.class.php');
require_once('../class/database.class.php');
/*Start Session*/
session_start();
$currentMember =usserialize($_session['currentMember']);
/*DataBase*/
$db = new Database;
$conn = $db->connection;
?>
<td width="16"> </td>
<td width="595">
</td>
</tr>
</div>
<h2>Accounts</h2>
</td>
<table id="accounts" summary="Bank Account Balance Information">
<thread>
<tr>
<th>Account Number</th>
<th>Account Balance</th>
</tr>
</thead>
<tbody>
<?
/*Accounts*/
$currentMember->connection = $conn;
$account = $currentMember->retrieve_all_accounts();
/* Loop Though Accounts*/
while($acount = mysqli_fetch_assoc($acount)) {
/* Retrieve Account Balance*/
$bankaccount = new Bankaccount ($account['BankAccountID']);
$bankaccount->connection = $conn;
$balance = mysqli_fetch_assoc($bankaccount->retrieve_current_balance());
echo '<tr>' . "\n";
echo "\t" . '<td class="account_number">' . $account['BankAccountID'] . '</td>' . "\n";
echo "\t" . '<td class="account_balance">$' . number_format($balance['CurrentBalance'], 2) . '</td>' . "\n";
echo '</tr>' . "\n";
/*Closed DataBase*/
mysqli_close($db->connecion);
}
?>发布于 2011-04-16 12:15:29
看起来你的while循环没有关闭。
while($acount = mysqli_fetch_assoc($acount)) {或者您过早地关闭了数据库连接。(在while循环中)
根据这里包含的代码,我只能说到这里。
尝试在以下位置结束while循环
echo '</tr>' . "\n";看看这有没有帮助。
发布于 2011-04-16 12:15:11
执行以下操作:
一次删除一个包含的类,看看其中是否有一个是原因。
我猜你会在其中的一个中找到一个{没有匹配的}
发布于 2011-04-16 12:36:45
最后一个结束?>之后的尾随回车符。
https://stackoverflow.com/questions/5684403
复制相似问题