首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP编码错误

PHP编码错误
EN

Stack Overflow用户
提问于 2011-04-16 12:07:15
回答 3查看 73关注 0票数 0

这是我的错误-它一定是我忽略了的东西,不确定它在哪里。

分析错误:语法错误,第107行的/home/mjcrawle/public_html/cit0215/assignment5/onlinebanking/viewaccounts.php中存在意外的$end

问候

代码语言:javascript
复制
<?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">&nbsp;</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);
}
?>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-04-16 12:15:29

看起来你的while循环没有关闭。

代码语言:javascript
复制
while($acount = mysqli_fetch_assoc($acount)) {

或者您过早地关闭了数据库连接。(在while循环中)

根据这里包含的代码,我只能说到这里。

尝试在以下位置结束while循环

代码语言:javascript
复制
 echo '</tr>' . "\n";

看看这有没有帮助。

票数 1
EN

Stack Overflow用户

发布于 2011-04-16 12:15:11

执行以下操作:

一次删除一个包含的类,看看其中是否有一个是原因。

我猜你会在其中的一个中找到一个{没有匹配的}

票数 2
EN

Stack Overflow用户

发布于 2011-04-16 12:36:45

最后一个结束?>之后的尾随回车符。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5684403

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档