This topic is locked

Use parameters in 'custom sql' step 4

3/13/2007 1:00:27 PM
PHPRunner General questions
M
mican author

Hello I have question. For example I have a user table and customer tabmle with
user

.......

userid

username

pwd

region
customer

......

custid

name

street

region
when I log in I want that user only see customers from his region. Can I use a parameter or a variable in

custom sql in step4 in the wizard like this:
Select * from customer where region=$user.region
or must I change something in the genareted code?
thank you

Sergey Kornilov admin 3/13/2007

I recommend to use Advanced Security mode "Users can see and edit their own data only". Link login table and main data table using region field in both tables.
No need to add parameters to SQL query.

M
mican author 3/13/2007

I recommend to use Advanced Security mode "Users can see and edit their own data only". Link login table and main data table using region field in both tables.

No need to add parameters to SQL query.


what do you mean with "link" should i join together? Or with master and detail?

J
Jane 3/14/2007

Sorry for misunderstanding.

You need to select region field in both "Main Table: OwnerID field" and "Users Table: OwnerID field" dropdown boxes on the Advanced security settings dialog on the Security tab.