![]() |
Sergey Kornilov admin 9/26/2006 |
It's not clear what you like to do with this query. Could you explain it further? |
M
|
markdorminy author 9/26/2006 |
Sure. Each record is tagged with two fields - one for a director and one for an analyst. If the director is logged in, I want for them to see their records only. If the analyst is logged in, I want for them to see their records only. This can't be accomplished with a "one-size fits all" sql statement because the "owner" data comes from two different fields. It also can't be accomplished with usergroups. I can generate two different views and set the security to accomplish this, but I was hoping there was a way that I could do it with one conditional sql statement. |
J
|
Jane 9/27/2006 |
Hi, if(SecuritySQL("Search")) $strSQL = AddWhere($strSQL, SecuritySQL("Search"));
if ($_SESSION["OwnerID"] == "analyst") $strSQL.= " where `TableName`.`analyst_id`='".$_SESSION["OwnerID"]."'" else $strSQL.= " where `TableName`.`director_id`='".$_SESSION["OwnerID"]."'"
|
M
|
markdorminy author 9/27/2006 |
Is there anything this thing won't do? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11382&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> |