Seichobob
Posts: 55
|
Posted: 07/26/2011, 7:39 AM |
|
hi folks,
i hope someone can help me... i have a table called "contacts". on a php site i have a editable grid where i can delete, update or add data records into mysql table contacts.
i have a search form above the grid where i can search contacts. i have a database field called "branch". after a user logged in into my system i have 2 sessions activated:
first one is called "NL_Acess", second one is "Full_Access".
lets say im logged in in my system and NL_Access = "2", NL_FullAccess is "1". the database field "branch" is either 1 or 2. i check now in the parameters overview like this:
SELECT *
FROM contacts
WHERE id = {s_id}
AND city LIKE '%{s_city}%'
AND branch= {NL_ID}
ORDER BY id
for example: when a user loggs in, he fills the session NL_Access with his branch. now i want to show only database entries for this user where NL_Access = database field branch. with this i can guarantee that a user only sees contacts belonging to his branch. BUT.. the second session NL_FullAccess can be 1 or 0. If branch is <> {NL_ID}, no contacts were found for this user. But i want to give him ALL CONTACTS if {NL_FullAccess} = 1.
have a look to a screenshot:
http://www.mpmedia.biz/1.jpg
i have no clue how to do that. if i open table parameters and put "1" into the field name, "=" in the next field AND NL_FullAccess in "parameter source" / type: session... nothing works... he says: Cannot find NL_FullAccess in Where clause.
i hope some understands what i mean...
thanks for your help...
greetings
|
|
|
ckroon
Posts: 869
|
Posted: 07/27/2011, 1:50 PM |
|
Try CCGetSession("NL_branch","") in the WHERE statement... use a SQL statement.
_________________
Walter Kempees...you are dearly missed. |
|
|
raphaelbiz
Posts: 10
|
Posted: 07/29/2011, 7:32 AM |
|
try let out "_" from session and mak "is null be ....."
_________________
linuxell.serveftp.com |
|
|
|