This topic is locked
[SOLVED]

 Pulling from multiple tables on View

8/6/2010 7:38:40 AM
PHPRunner General questions
K
kkiboo author

I was wondering if it was possible to pull data from multiple tables (not joined, separate) on the View page.
Ex:
I have a table of orders that can be tracked by employee, also audits for those orders, and training data. I have a page for the table of employees; when I click "View" to view the employee record data, I would like to be able to also show all the information pertaining to them from the other tables (their orders, their audits, their training).
Is anything like this possible?

A
ann 8/6/2010

Hi,
you can join tables on the Edit SQL query tab. Then uncheck fields from other tables on the Choose fields tab for all pages (List, Add, Edit, etc.) except the View page.

K
kkiboo author 8/6/2010

Right, but I don't want to join the tables.
Thanks anyway.

A
ann 8/6/2010

Hi,
then you can manually grab field values one by one from other tables (Insert PHP code snippet option on the Visual Editor tab)

or insert Views of other tables using <iframe> tag in the HTML mode on the Visual Editor tab.

K
kkiboo author 8/6/2010



or insert Views of other tables using <iframe> tag in the HTML mode on the Visual Editor tab.


This is exactly what I need - I am familiar with iframe, but how do I insert a View of another table?

A
ann 8/6/2010

Hi,
here is a sample:

<IFRAME height=700 src="TableName_view.php?editid1=1" width="100%">

</IFRAME>



More information:

http://www.w3schools.com/tags/tag_iframe.asp

K
kkiboo author 8/6/2010



Hi,
here is a sample:

<IFRAME height=700 src="TableName_view.php" width="100%">

</IFRAME>



More information:

http://www.w3schools.com/tags/tag_iframe.asp


Oh... you meant actually just use the iframe to view the view page for another table.
What I was looking for was a way to pull up info from another table using a where clause (where employee=bob, for example) and view that on Bob's employee page.

J
Jane 8/9/2010

Hi,
to show data from another table use custom event (Insert PHP code snippetoption on the Visual Editor tab).

Here is just a sample:

$str = "select FieldName1,FieldName2 from Tablename where employee='bob'";

$rs = CustomQuery($str);

$data = db_fetch_array($rs);

echo "FieldName1".$data["FieldName1"];

echo "FieldName2".$data["FieldName2"];
K
kkiboo author 8/9/2010

Hi, thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51742&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
When I run this code, I get an error from oracle: ociexecute() [function.ociexecute]: ORA-01722: invalid number
I double checked, I made sure I got the table name, field names, etc right.

K
kkiboo author 8/9/2010



Hi, thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51751&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
When I run this code, I get an error from oracle: ociexecute() [function.ociexecute]: ORA-01722: invalid number
I double checked, I made sure I got the table name, field names, etc right.


I fixed the invalid number error. There is no error now, BUT, when I run this, it echos only 'FieldName1' and does not display the data it was retrieving.

K
kkiboo author 8/9/2010

Also, is there anyway to make 'bob' or whatever Employee needs to be looked up a variable? like {Employee_Value}? I tried it with that syntax and it gave an error. :\

A
ann 8/10/2010

Hi,
It's difficult to tell you what's happening without seeing actual files.

I would suggest to zip and send your project file to support@xlinesoft.com for investigation.

K
kkiboo author 8/12/2010

It turns out what I needed was a view on the original table, then linking it to the employee table and only having to checked to display on the view page.
One last question:
For the detail table control, is there a way to paginate those records? I know you can set it to paginate on the view table's list page, that's not what I'm looking for: I'm looking for a paginate for the detail table control, the link to the employee.
Is this possible? Thanks.

J
Jane 8/13/2010

Hi,
I'm not sure that I fully understand you.

Could you send a couple of screenshots explained what you want to achieve to support@xlinesoft.com?