This topic is locked
[SOLVED]

 Lookup table

12/15/2010 9:04:11 PM
PHPRunner General questions
B
bprosic author

I have two tables in database. One table is called 'the_firm' (with firm_owner_id and adress)

and the other table is called 'customer' (with customerId, name, surname, adress and telephone).
In phpRunner I created those tables.
The 'firm' table has only one row with general information about the firm. Nothing else! Ok?
In 'customer' table there are a lot's of data (I mean rows of data), and when I decide to print one of the customer,

then I would like to have general information displayed (from 'firm' table) in the header of the document,

and in the middle of the document details of the customer.
How can I do that in phpRunner??
I tried with master->details management and with table lookup wizzard, but I failed.
Thank you for your quick response.

Sergey Kornilov admin 12/15/2010

You need to use Master-Details relationships here. When you proceed to details screen master info is displayed on the top.
Here is an example:

http://livedemo.asprunner.net/phprunner/livedemo1/order_details_list.php?mastertable=orders&masterkey1=10248
I guess you can provide more details on what exactly you tried and what didn't work.

B
bprosic author 12/16/2010



You need to use Master-Details relationships here. When you proceed to details screen master info is displayed on the top.
Here is an example:

http://livedemo.asprunner.net/phprunner/livedemo1/order_details_list.php?mastertable=orders&masterkey1=10248
I guess you can provide more details on what exactly you tried and what didn't work.


Ok, here is my question.
Look at the picture attached in this text. picture Please be patient - it's slow server sometimes...
Number 1. marked in picture represents one table - 'firm', and number 2. represents second table - 'customer'.
For every customer that arrives I need to print a document with customer details for my customer.

Now, my question is, how can I put the table 1 (just general 'firm' information) to show on every customer document? On the header of the printed document.

I know that I can modify header page in HTML, but when I decide to change something (example, to change a telephone number) it would be easier to do it in the table 'firm'.
Do you, maybe, understand me?
Thank you for your quick response!!

Best regards.

Sergey Kornilov admin 12/16/2010

I see what you saying.
You can modify SQL Query of Customers table joining Firm table.
Something like:
select

customers.,

firm.


from Customers

inner join Firm on Customers.CustomerID=Firm.CustomerID
More info on SQL Query modification:

http://xlinesoft.com/phprunner/docs/query_designer.htm
Then on Customers View/Edit pages you can rearrange fields moving fields from Firm to the top.

To find how you can modify forms watch 'How to build advanced webforms' tutorial at http://xlinesoft.com/phprunner/php-database.htm