This topic is locked

lookup wizard WHERE clause

1/26/2008 7:50:41 PM
PHPRunner General questions
S
shango author

Hi, I'm trying phprunner and have a question about using the lookup wizard.
I have 3 tables.

One master table named Episodes

Two detail tables named Locations and Shots

Both Locations and Shots are detail tables to Episodes.
In the Shots table, the field named location is being used

to lookup data from the the Location table.
I want the data that appears in the dropdown to be filtered

with respect to the Episode record I'm in.

However, location data from all episodes is displaying

regardless of which episodeID is contained in the location tables fk fields.
Is there a WHERE clause I can use to filter only the location data from

the Master Episode record I'm currently within?
Here's a look at my tables.
EPISODES TABLE

episode_num

episodeID (pk)
LOCATION TABLE

location

locationID (pk)

episodeID (fk)
SHOTS TABLE

shot_num

location

shotID (pk)

episodeID (fk)
Thanks in advance for any help.
SG

J
Jane 1/28/2008

Hi,
to filter records add where clause on the "Edit as" settings dialog on the Visual Editor tab.

Here is a sample:

"episodeID=".$_SESSION["SHOTS_masterkey1"]