This topic is locked

Edit SQL Query page and $_SESSION['UserID']

5/4/2009 12:27:13 PM
PHPRunner General questions
H
hernanccs author

Hi guys,
I have a table with a around 10 columns, one of those columns is called user and it contains the UserID of the user who created the record. Now, im trying to filter the results of my query based on the UserID, so the users can only see on the list page the records they created. Based on the posts i have read i should be able to do that by just adding ='$_SESSION["UserID"]' to the filter on the Edit SQL Page on the User column; but when i do that i get no results at all on the list page.
Any idea?
Thanks

Sergey Kornilov admin 5/4/2009

Proceed to Security screen, click 'Advanced security' and choose 'Users can see and edit their own data only' mode.

H
hernanccs author 5/4/2009

Proceed to Security screen, click 'Advanced security' and choose 'Users can see and edit their own data only' mode.



thanks that worked great <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40766&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

D
d_gan 7/18/2009

Proceed to Security screen, click 'Advanced security' and choose 'Users can see and edit their own data only' mode.


I got a custom view of same member table where is refer to UserID as referral so I can't use this way under Security.
Can someone tell me how to filter table with login ID

I have tried put this in the table filter

WHERE AgentID = '$_Session("'"UserID"'")'

WHERE AgentID = '$_Session("UserID")'

But it did not work.
Only if I manual edit the file_variable.php page

I replace with this

$gsqlWhereExpr="AgentID = '".$_SESSION["OwnerID"]."'";

or with $_SESSION["UserID"] work too.
But this will change once I press build. I will have to edit this again. Is there work around so I can do it in PHPrunner itself so I can save the work.

J
Jane 7/20/2009

Hi,
use List page: Before SQL query event on the Events tab for this purpose.

Here is a sample:

$strWhereClause = whereAdd($strWhereClause," AgentID = '".$_Session("UserID")."'");