(adsbygoogle = window.adsbygoogle || []).push({});
Displaying Database Information Of Current Logged in User Tutorial 1
This is My First PHP Tutorial so i hope it helps all you beginners out there
How to Show a Users Information from Database
To Show a Users information from a row all you have to do is Select the Row Where the Users ID is In A query, then Fetch all The Columns
<?php
$user = new USER();
$user_id = $_SESSION['user_session'];
$stmt = $user>runQuery("SELECT * FROM user WHERE user_id=:user_id");
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<h1>Welcome Back ! <?php print($userRow['username']); ?></h1>
Im Using the column name username as an example
You Would replace this with the name of the column with information you would like to show
This Would Output
Welcome Back! Crxsho
I will be posting more PHP Tutorials like this because i see that this Part of the Forum isn't That active
Thank you and i hope this Helps People Creating websites
By Crxsho or (pumahmodzuk)