hi all,
I have a problem creating a "subform" in PHP. I use MySQL as my database.
what i want to create is a Sales Order form that submit data to database. It has Document No. as the master's Primary Key, and Document No. and Line No. as the child's Primary key.
For the illustration:
================================| Master
Document No : SO-0001 |
Order Date : 01/27/07 |
================================|Detail
Line No. | Item No. | Quantity |
======== |====== |================|
1 | OP-001 | 1,000 |
2 | OP-002 | 1,500 |
3 | OP-003 | 2,550 |
=================================
i hope you can help me solve my prob.. thx
Sub-form (master-detail form)
Moderator: General Moderators
-
bloodflower
- Forum Newbie
- Posts: 1
- Joined: Thu Jan 11, 2007 12:48 am
In the Detail table you need to have a reference to the Master table like the "Document No" otherwise how are you going to now what and when?
For the illustration:
================================| Master
Document No : SO-0001 |
Order Date : 01/27/07 |
================================|Detail
Line No. | Item No. | Quantity | Document No. |
======== |====== |================|
1 | OP-001 | 1,000 | SO-0001 |
2 | OP-002 | 1,500 | SO-0001 |
3 | OP-003 | 2,550 | SO-0001 |
=================================
For the illustration:
================================| Master
Document No : SO-0001 |
Order Date : 01/27/07 |
================================|Detail
Line No. | Item No. | Quantity | Document No. |
======== |====== |================|
1 | OP-001 | 1,000 | SO-0001 |
2 | OP-002 | 1,500 | SO-0001 |
3 | OP-003 | 2,550 | SO-0001 |
=================================
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Form and subform sound quite a bit like Access. What is your intended implementation of this? I only ask because it sounds almost like you want a form with another form that is related to the main form that you can interact with while not messing with the main form. If that is the case, this is just a simple select query where the subform is the form in which you actually capture the data, then post it back for processing.