This topic is locked

Detail relations in view page?

7/1/2009 8:23:08 AM
PHPRunner General questions
U
uludag author

Hi,
Is there a way to show detail relations in view page?
I also wonder if it could be possible that view page wrap detail relations automatically, I mean there will be no need to click the detail link. In other words, view page will contain, after master table, detail records in a embedded way. Can I do it with phprunner?
Sincerely,
Uludag.

J
Jane 7/1/2009

Hi,
Unfortunately PHPRunner do not support to add detail records to the master view page automatically.

You need to select and print detail records in the custom event (Insert PHP code snippetoption on the Visual Editor tab) manually for that.

U
uludag author 7/2/2009

Hi Jane,
You are kind enough to answer immediately, as usual. Thank you very much.
Unfortunately, I am not familiar with php and I do not know what kind of a code I have to insert.

The name of my master table is "academicstaff"; and the names of detail tables are "books", "articles", "papers", "encyclopedicentries", "translations", etc.

.

Would you provide me with an example for the proper code?
Sincerely yours,
Uludag.

Hi,

Unfortunately PHPRunner do not support to add detail records to the master view page automatically.

You need to select and print detail records in the custom event (Insert PHP code snippetoption on the Visual Editor tab) manually for that.

J
Jane 7/2/2009

Hi,
here is just a sample:

global $dal;

$rs = $dal->academicstaff->Query("IDField=".$_REQUEST["editid1"],"");

$data = db_fetcj_array($rs);
echo "Books table
";

$rs2 = $dal->books->Query("DetailKey=".$data["MasterKey"],"");

while ($data2 = db_fetch_array($rs2))

{

echo "FieldName1: ". $data2["FieldName1"]."
";

echo "FieldName2: ". $data2["FieldName2"]."
";

}



where IDField and MasterKey are your actual field names in the academicstaff table, DetailKey is your actual field name in the books table.

U
uludag author 7/2/2009

Hi Jane,
Thank you very much, again and again.
As far as I know, I will have to make some changes in this code.
Am I supposed to change the bold words below?
In my project: Master Link: KimlikID, and Detail Link: AuthorName. I would like to show "BookTitle", "Publisher", "PublicationPlace", "PublishYear", "Pages", "Edition" fields from detail table.
Thanks in advance for your patience with me.
Sincerely yours,
Uludag.

global $dal;

$rs = $dal->academicstaff->Query("IDField=".$_REQUEST["editid1"],"");

$data = db_fetcj_array($rs);
echo "Books table
";

$rs2 = $dal->books->Query("DetailKey=".$data["MasterKey"],"");

while ($data2 = db_fetch_array($rs2))

{

echo "FieldName1: ". $data2["FieldName1"]."
";

echo "FieldName2: ". $data2["FieldName2"]."
";

}

J
Jane 7/2/2009

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll help you with sample code.

U
uludag author 7/2/2009

I sent it.
Thank you for your interest.
uludag.

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages and I'll help you with sample code.