This topic is locked

Where Clause

3/16/2009 10:15:01 AM
PHPRunner General questions
H
hernanccs author

Hi all
I want to limit the options on a dropdown box using the Where field on the Lookup table settings
I have a table with two fields, one is called Users and the other is called Usernames; i want the dropdown box to display the Username for the user that is currently logged on depending on the UserID
If i write expressions like these in the Where box, the Dropdown list just display the name for that specific user

"User='User1'" then dropdown just shows Username1

"User='User2'" then dropdown just shows Username2
But if i write this expression to get the username for every user that logs on

"User=".$_SESSION["UserID"]

i get the following error

Unknown column 'username1' in 'where clause'
any help would be really appreciated

Sergey Kornilov admin 3/16/2009

Make sure text values in WHERE clause are wrapped by single quotes i.e.

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