I simply need to display data from a mysql database. All the data is already stored in the database when the user submits the form. So in the landing page after the user is logged in, I need to display the users full name as well as a few other columns from the database table. In essence, I want the page to say Welcome fullname, then display some other colums from the database in a table. How should I code this using session? NOTE: I have tried to use sessions to display the user's full name and current balance after logging in. My code below:
<?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'] = $fullnameand before using it you need to start the session