This topic is locked

login name in sql statement

10/3/2005 10:00:45
PHPRunner General questions
coolbyte author

Our Clients can order some items from our partners. If so, the item name is added to an options-Field in the Database. I would like to give the partners access to those clients, which have ordered an item from the partner. Therefore I would like to filter the output like this
select * from database where option like '%login_name%'
Note, that the option field can hold several items (eg. 'option1 option2'). For each item a login shall be created.
How is it possible to use the login name in the select statement of the phprunner dialog?

Sergey Kornilov admin 10/4/2005

Hi,
to filter values in dropdown box please enter the following in Where box of Lookup Wizard dialog on Formattingtab in PHPRunner.

"option like '%".$_SESSION["UserID"]."%'"

coolbyte author 10/4/2005

Thanks for the info. I would like to filter the whole data row in that way that only that rows are shown which have the login name in the option field. Can I write your statement in the main select clause in the phprunner dialog?

Sergey Kornilov admin 10/5/2005

No, this wouldn't work in PHPRunner wizard.
However you can add a WHERE statement to $gstrSQL variable in include\..._variables.php file after pages generation.

You can do it this way, see my changes in bold:

$gstrSQL = "select .... from ... where option like '%".$_SESSION["UserID"]."%'";