This topic is locked

Basic Help Needed Please

4/11/2009 2:51:07 PM
PHPRunner General questions
G
guy author

Hi all,
Your expertese would be very much appreciated here.
I have three tables:

  1. SchoolData - Columns are: Name, RegionID and TypeID
  2. Region - Columns are: RegionID and RegionName
  3. Type - Columns are: TypeID and TypeName
    In my main table (SchoolData) I'd like to see Name, RegionName and TypeName on the list, edit and search pages etc. rather than the RegionID and TypeID
    How do I do this? If someone could give me the code I'd really appreciate it. I've tried following the help topic on joins but I'm getting nowhere.
    Many thanks,
    Liu

    <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11536&image=1&table=forumtopics' class='bbc_emoticon' alt=':ph34r:' />

vin7102 4/13/2009

Hi Hiu,
If I'm understanding correctly I believe you will want to open the Query page and select the SchoolData table from the list on the left, then click the "Add Table" tab and select Region from the list and do the same for your Type table.

The three tables will be visible on top and you will want to check the boxes for the fields you want to appear and uncheck any that you dont want to appear in your SchoolData pages. All the fields you want to be visible should have the "Output" box checked below.

Then go to the Fields page and verify your field selections for your pages.

Hope this helps...
Regards,

Vince

S
Shankar 4/13/2009

Hi all,

Your expertese would be very much appreciated here.
I have three tables:

  1. SchoolData - Columns are: Name, RegionID and TypeID
  2. Region - Columns are: RegionID and RegionName
  3. Type - Columns are: TypeID and TypeName
    In my main table (SchoolData) I'd like to see Name, RegionName and TypeName on the list, edit and search pages etc. rather than the RegionID and TypeID
    How do I do this? If someone could give me the code I'd really appreciate it. I've tried following the help topic on joins but I'm getting nowhere.
    Many thanks,
    Liu

    <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40064&image=1&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />


Hi.

You want something like this:
List/View pages:
Select

<fields you want>

from schooldata

(inner) join region on region.regionid = schooldata.regionid

(inner) join type on type.typeid = schooldata.typeid
Note, you can't edit joined pages, so you have to add/edit this data from the schooldata table using edit as in Visual Editor using look up.
HTH

Shankar.