I am using PHP and have session_start(); and $_SESSION[‘username’] at the top of the page. The user is logged in just fine.
The problem is, I am trying to pull and display data from just the user that is logged on. Below is my current query and it is pulling from the first user in the table, not $_SESSION[‘username’] user. How do I adjust SELECT to specify to pull from the current logged on user? Thanks.
$result = mysql_query("SELECT * FROM members")
or die(mysql_error());
$row = mysql_fetch_array( $result );
echo "<strong>bio:</strong> ".$row['bio'].'<br />';
You should read up on SQL and while you’re at it, learn about SQL injections.