I am currently working on a member login script that uses PHP, Mysql, and Jquery (What I need help with only pertains to the PHP and Mysql database though). I am using a tutorial/script for this: Tutorial
So my scripting at the moment looks similar to the coding in the tutorial, with changes for my specific Mysql database. What I am currently trying to achieve is that once a user is logged in, I want specific information to be shown to them, such as their name, rank, etc. I have rows in the mysql database for this that also houses the ID, username, etc. Specifically, there is a spot that I want it to show in the script, which is shown in the "demo.php" part:
<?php
// FROM TUTORIAL PAGE
if(!$_SESSION['id']):
?>
[...]
<?php
else:
?>
<div class="left">
<h1>Members panel</h1>
<p>You can put member-only data here.
</p>
<a href="registered.php">View a special member page</a>
<p>- or -</p>
<a href="?logoff">Log off</a>
</div>
<div class="left right">
</div>
<?php
endif;
?>
Where it says "you can put member-only data here", I want the code to pull from the database to show the information I want specific for the username logged in. For example, if user "dan124" is logged in, where member-only data is, I want it to show dan124's current rank, points accumulated, stuff like that. An example is one row that I want pulled from the database is "pts".
I have tried several different codes and tinkered with some stuff I have found, but I cannot get what I'm trying to achieve. I know my way around basic database pulls, but this is my first time working specifically with logged in user based info.
If anyone can help with this, I'd really appreciate it. I'm sure I'm not the first person who has used the tutorial I'm working with and wanted this kind of information pull, I just can't find anything! If you need more info, let me know.