More specifically I can't get the $last_name to display at all.
In the following code:
$name_and_date = "$first_name $last_name | $today | <a href=\"logout.php\">Log out</a>";
Here is more of the code.
// Place Session variables into local variables
$user_id = $_SESSION['user_id'];
$first_name = $_SESSION['first_name'];
$last_name = $_SESSION['last_name'];
$email = $_SESSION['email'];
$registration_date = $_SESSION['registration_date'];
// Convert the sign up date to be more readable by humans
$registration_date = strftime("%b %d, %Y", strtotime($registration_date));
// Use PHP to find today date and get it ready for display
$today = date("F j, Y");
$name_and_date = "$first_name $last_name | $today | <a href=\"logout.php\">Log out</a>";
require_once ('../mysqli_connect.php'); // Connect to the db.
// Query member data from the database and ready it for display
$mysqli = new mysqli("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"SELECT * FROM users WHERE user_id='$user_id'");
if (!$dbc) {
// There was an error...do something about it here...
print mysqli_error();
} else {
while($row = mysqli_fetch_array($dbc)){
$city = $row["city"];
$zip = $row["zip"];
$bio_body = $row["bio_body"];
$last_name = $row["last_name"];
}
}