This topic is locked
[SOLVED]

 Using Session Variable in a FILTER

5/27/2011 12:24:55 PM
PHPRunner General questions
bbarker author

Any idea why this FILTER isn't working for me?
I enter it on the Query Page in the Year column as a filter, but the results are blank:

= \".\$_SESSION[`CurrentYear`]\""


In the PHP page it shows up as:

$gsqlWhereExpr="tblstalls.`Year` = \".\$_SESSION[`CurrentYear`]\"";


And now, in PHPRunner it shows up as a new column item:

"tblstalls.`Year` = \".\$_SESSION[`CurrentYear`]\""



with "= True" in the Filter column

J
Jane 5/30/2011

Hi,
PHPRunner do not support to use PHP variables on the Edit SQL query tab. Use Before SQL query event on the Eventstab instead.

Here is a sample:

$strWhereClause = whereAdd($strWhereClause,"tblstalls.`Year` = ".$_SESSION['CurrentYear']);
bbarker author 5/30/2011

Fantastic... it works!!! After all this time, I didn't think that I'd ever get this to work... thank you very much for working this COLD CASE!!!

G
garethpDevClub member 5/30/2011

Hi. Will this cause problems in current phprunner version with details preview and child count?
Thanks

Gareth