0
錯誤是致命錯誤:調用未定義的方法stdClass的:: retrieve_all_accounts()在/home/mjcrawle/public_html/cit0215/assignment5/onlinebanking/viewaccounts.php在線72PHP BD錯誤行72
我沒有得到任何html錯誤,所以我會離開它。
我的PHP代碼到錯誤是:
<?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 =unserialize($_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>
<php?
/*Accounts*/
$currentMember->connection = $conn;
這是我得到的錯誤線72:
$accounts = $currentMember->retrieve_all_accounts();
/* Loop Though Accounts*/
while($account = mysqli_fetch_assoc($account)) {
/* 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->connection);
?>
也許沒有像retrieve_all_accounts()這樣的方法? – Robus 2011-04-16 15:30:02