我只需要显示来自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