我只需要顯示來自mysql數據庫的數據。用戶提交表單時,所有數據都已存儲在數據庫中。因此,在用戶登錄後的登錄頁面中,我需要顯示用戶全名以及數據庫表中的其他一些列。實質上,我希望頁面說歡迎全名,然後在表中顯示數據庫中的一些其他列。我應該如何使用會話進行編碼? 注:我曾嘗試使用會話登錄後顯示用戶的全名和當前餘額 我的代碼如下:使用會話在網頁中顯示來自mysql數據庫的數據
<?php
// Connect to database display welcome Full name, then date, name, credit, debit, balance
session_start();
$fullname="";
$currentbalance="";
if (!isset($_SESSION)){
session_start();
}
echo $_SESSION['fullname'];
?>
Welcome <?php echo $_SESSION['fullname']; ?>.
<table border ="1">
<th>DATE </th>
<th>'.$fullname.' </th>
<th>CREDIT </th>
<th>DEBIT</th>
<th><?php echo $_SESSION['currentbalance']; ?</th>
</table>
需要分配值變量'$ _SESSION [「全名」] = $ fullname',你需要啓動會話使用前 – 2013-03-05 08:20:11
確定我會嘗試,現在。那是我所沒有做的嗎? – Kaos 2013-03-05 08:22:49