This topic is locked

Filter within Lookup wizard

2/23/2009 5:41:18 PM
PHPRunner General questions
J
jbisko author

I am having a lot of trouble trying to figure out the syntax.

I have a datafield that uses the LookUp Wizard to populate a dropdown list from a look up table.

However, i also want the drop down list to be filtered only based on the table entries that belong to the currently logged in user.
So, My Lookup table is called "agency"

My Link field from the main table is ID.

The Display field is "AgencyName"
So, in order to do the filtering, I am tryin to get the correct Syntax entered in the

'WHERE' section of the "Edit As" lookup wizard dialog.
The "agency" table has a UserID that is a string.

Also, after successfull login, I have set a global string variable called $_SESSION["CurrentUser"] = to the user name.
In the Where field, I have tried all sorts of variations of the following, but nothing seems to work correctly.

Perhaps, it is the string variable types that are causing the problems because of all the nested quotes
"UserID=".$_SESSION['CurrentUser']

'UserID'="$_SESSION['CurrentUser']"

"UserID=\"$_SESSION[\"CurrentUser\"]"
etc...
Can someone help me with the correct way to do this filter?
Thanks,
Jeff

Sergey Kornilov admin 2/23/2009

Try this:

"UserID='" . $_SESSION['CurrentUser'] . "'"
J
jbisko author 2/23/2009

Try this:


"UserID='" . $_SESSION['CurrentUser'] . "'"


That works.

So, simple when you know what to do!

Thanks Sergey.
-Jeff