I'm creating a client area kind of website in PHP or web host management which will have the details of the client and also the details of their web account.
This is my table
ID----USER----NAME----ACCOUNT----PASSWORD
1----user1----name1----accont1----password2
2----user1----name2----accont2----password2
3----user3----name3----accont3----password3
Now what I want to know is how can I only get the account details of user1 and display it in PHP. Like this,
You are user1
Your Accounts are accont1 & accont2 and
their passwords are password1 & password2 and
their name is name1 & name2
BTW! the name1 and name2 are the name of the hosting account and I use PDO for connecting to mySQL
Thanks in advance!!!
Edit: This is how I manually create the variables and insert it in my HTML
$id2 = "2";
$stmt2 = $conn->query("SELECT * FROM accounts WHERE ID = $id2");
$row2 = $stmt2->fetch();
$uname2 = $row2['account'];
$label2 = $row2['name'];
Now what I need is I want to show id 1 & 2 automatically after login and if you please help me on how to do that too!!! I'm a beginner so please consider helping!!!