[SOLVED] Using $_SESSION("UserName") in an SQL query? |
8/13/2012 2:25:47 PM |
PHPRunner General questions | |
L
lane author
Hi, SELECT
|
|
C
|
copper21 8/13/2012 |
What page are you trying to use this on? |
C
|
cgphp 8/13/2012 |
$_SESSION is an associative array containing session variables available to the current script. Array in PHP use [ not (. Check the manual: http://php.net/manual/en/reserved.variables.session.php |
L
|
lane author 8/13/2012 |
What page are you trying to use this on?
$_SESSION is an associative array containing session variables available to the current script. Array in PHP use [ not (.
SELECT
print_r($_SESSION("UserName") displays the correct value. |
C
|
cgphp 8/13/2012 |
It's not clear what you are trying to do. The following code is wrong: print_r($_SESSION("UserName")
|
L
|
lane author 8/17/2012 |
Thanks for your replies. I did end up finding the solution to my issue. In the "Before SQL Query" event for the page, I added the following line: $strWhereClause = whereAdd($strWhereClause, "Owner='". $_SESSION["UserName"] ."'");
|