Sub-form (master-detail form)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bloodflower
Forum Newbie
Posts: 1
Joined: Thu Jan 11, 2007 12:48 am

Sub-form (master-detail form)

Post by bloodflower »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Sorry, I have no idea what, specifically, you're asking.
User avatar
louie35
Forum Contributor
Posts: 144
Joined: Fri Jan 26, 2007 8:40 am
Location: Dublin
Contact:

Post by louie35 »

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 |
=================================
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

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.
Post Reply