Drawing up a session value within SQL query? PHP and MySQL

Posted by Derek on Stack Overflow See other posts from Stack Overflow or by Derek
Published on 2010-03-15T14:20:30Z Indexed on 2010/03/15 14:29 UTC
Read the original article Hit count: 171

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql