Hi, need help displaying data from a user logged in such as the firstname and lastnane.
Here is my code:
the database table is named auth_users with username, firstname, lastname, password as fields.
I just want to show the first name and last name on the users profile.
[php]session_start();
// check session variable
if (isset($_SESSION[‘valid_user’]))
{
echo "Welcome to your profile “; echo $_SESSION[‘valid_user’]; echo " !!!”;
echo “First Name: Data from database”;
echo “Last Name: Data from database”; }
else { echo “not logged in”; }
[/php]
What do I do? I need a way to connect to the mysql database to grab data for the user that is currently logged in to show the firstname and lastname.