This topic is locked

WHERE with $_SESSION['variable']

5/18/2009 7:18:34 PM
PHPRunner General questions
W
wilri01 author

There's certainly the BEFORE SQL QUERY event to add a WHERE clause to a table, but I didn't see one for the preview or detail link on a master-detail relationship.
This application is for events with tasks. Depending on where the user comes from in the larger Intranet application, only the events/tasks for a specific user, or specific team, or a global view with no restrictions is needed. It's easy to set a $_SESSION variable from a $_REQUEST parameter, but it's not easy to put that value in the WHERE of the detail/preview query - unless I've overlooked something.
So is there a global variable that would have the WHERE string for all tables, or at least the preview/details/detail_count queries that a list "before query" event could set to add some predicates?
Any ideas on a different approach? I tried adding the predicate to the table's SQL, but couldn't get past the syntax error for the $_SESSION variable. Also got error when manually editing the generated variables include member.

W
wilri01 author 5/19/2009

I found another way to do the detail link by using a custom view that contains a column with the link to the detail records, filtered by team_id.
Set the column as a hyperlink in the Visual Editor, and don't set a master-detail relationship because the link serves this purpose.
There's no preview, but at least the right rows are showing now.