Drawing up a session value within SQL query? PHP and MySQL
- by Derek
Hi, on one of my web pages I want my manager user to view all activities assigned to them (personally). In order to do this, I need something like this:
$sql = "SELECT * FROM activities WHERE manager = $_SESSION['SESS_FULLNAME']";
Now obviously this syntax is all wrong, but because I am new to this stuff, is there a way I can call up the full name from the user's session within a query? This is so that when I call up the database values to be displayed within the web page, only the activities for the manager who is logged in is displayed. For example, the activities table has a manager column of a full name entry. Any help is much appreciated. Thanks.