Saving form data in 2 table

Order :

 ORDER IDPremix TypeQuantityDatetime

Order Sub Details :

ORDER  Sub IDORDER IDPremix TypeQuantity

Hi guys,

I have situation and need your help, I have apps for order an item. I have order table and order sub details table. Order table is main table that save all data. in Order Form there have function to select premix type, when user click choose premix type, the it will go to order sub details, user can select premix type and enter the quantity then save and it will save in Order Sub Details table. If user want to add more premix type, user can add new and it will go again to sub order details form.

My question is, I want to save premix type and quantity from Order Sub Details into Order table when user click save when they finish choose premix type.

0 6 197
6 REPLIES 6

hi

one question, you want to add new rows only from the "order sub details" form?

Hi, 

Thank you for your response, when i save save data from order sub details, i want also some field also insert in order table. Example

Order :

 ORDER IDPremix TypeQuantityDatetime
 rock200  

Order Sub Details :

ORDER  Sub IDORDER IDPremix TypeQuantity
101rock200

I want premix type field from order sub details item insert also in order table in premix type field.

If you have other way, I hope you can help me

 

Thank you

Alright, I get you.

I leave you a link to a youtube video from @MultiTech call "many to many" .  There you can get an idea of the steps for what u want to do. Although it may take u some time to implement.

many to many video

Thank you for sharing, I will see the video to get an idea.


@gymbuddy wrote:

I want to save premix type and quantity from Order Sub Details into Order table when user click save when they finish choose premix type.


I'd advise re-thinking this part of your system

What happens if someone orders more than one premix for an order?

If that's not possible, then why wait until the Order_Detail record to select the premix they're ordering?  Do you even need the Detail side of things?  Could you combine both elements into a single order record?

Generally, when I'm building a parent-child ref like this - especially for an ordering system - the idea is usually, "I need to add X number of different things to my 1 single order"

That's where the parent-child side of things comes into play.

But if you don't need to, I wouldn't include the reference like this.

-----------------------------------------------------------------------------------------

It sounds like you're not looking for a many-to-many, but instead a one-to-many.  You might check out my Shopping Cart evolution series, it shows various development stages of an ordering app; you might find inspiration there.

-----------------------------------------------------------------------------------------

Thanks @Luis_Rodriguez_ for the plug!

Thank you for your advice, I will see the example that you share to me..in my case, I need to send Whatsapp message but some information in details order and some information in Order Sub Details. The phone no that i want to send Whatssap message in order details table. 

Top Labels in this Space