This topic is locked

Using Where Clause in Drop Down Lists

5/7/2007 4:34:09 AM
PHPRunner General questions
H
hlewis author

Hi,
I'm sure there is a simple solution to this.
I'd simply like to have a drop down list that only shows values that match user id. I have created the drop down on a 'address line 1' field on an Add Page. Using the Look Up Wizard, I have selected the Lookup Table (which is Addresses) and selected 'address line 1' for both the link field and the display field and checked the unique values. In the WHERE clause I have entered $_SESSION["user_id"] = "user_id". The user_id column is present in the Addresses Lookup Table.
Now, when it is run the drop down list shows all the values from the address line 1 column when I'm expecting to just see the ones that correspond to the logged in user id as per the SESSION variable?
Any suggestions anyone.
Thanks in advance.

V
Vladimir 5/7/2007

Hi,
try to use this code in WHERE clause:
"User_ID = '". $_SESSION["UserID"]."'"
If this doesn't work give me a bit more info about your data.

What values are stored in user_id fieled ?

How this field is related to user currently logged in ?

H
hlewis author 5/7/2007

Hi,

try to use this code in WHERE clause:
"User_ID = '". $_SESSION["UserID"]."'"
If this doesn't work give me a bit more info about your data.

What values are stored in user_id fieled ?

How this field is related to user currently logged in ?


Thanks Vladimir. I will go off and try that. Do I need to omit the underscore in the square brackets? The user id is actually account id (numeric value) and is the unique id for a user account, so that's where the relationship is.

H
hlewis author 5/7/2007



Thanks Vladimir. I will go off and try that. Do I need to omit the underscore in the square brackets? The user id is actually account id (numeric value) and is the unique id for a user account, so that's where the relationship is.


Hi, tried it but it didn't seem to work?

Sergey Kornilov admin 5/7/2007

Any error messages?
If this doesn't work contact me directly at support@xlinesoft.com.

H
hlewis author 5/7/2007

Sergey,
No, there are no error messages. I'm using PHPRunner 3.1 Build 218 if that helps. Will e-mail you direct. Anything further you require in the e-mail?

Sergey Kornilov admin 5/7/2007

To speed up the process you can post your app to Demo Account and send me a link along with order number or registration email.