Insert Record - Table Parent + Child

exactly
sorry for my bad english
I will study again

Guys, are you referring to actually inserting database records or just display records on the page?

inserting my records

Ok, it’s not really clear what you need to achieve.
Can you try with a few simple sentences and maybe some screenshots to just explain what needs to be on your page and what needs to be inserted in your database?

Number Document 1 (Master+Details)

Number Document 2 (Master+Details)

I hope I explained myself, I have to save the invoices in the database

So these are some resulsts from a query? You filter by document (is that a dropdown?) and below it you get a repeat region with the results?
Are you reading these from a database, or?

Yes, right
I have to insert the document and document lines in two different tables
the first table is doc
the second table is doc_details where the id is id of the doc table

I already understand you want to insert them in two tables and I already explained you how to do so.

My question is where these things come from on your page? (The images you posted)

text input for master data
table for details data

You could have a look at @ben gallery tutorials. It is almost what you need but without the images. [https://www.youtube.com/playlist?list=PLUjqTJN3byC9kK8YZkmGwjo9nrEipl2yb]

You guys really lost me here :slight_smile:

Text input is fine. You enter something using your keyboard.

What about the table below? How do you populate it before inserting? And how do you insert all of this - is it using a button?

Haha, finally I get something to explain instead of the other way around. What he wants is like this:

  1. List of categories (master)
  2. List of (multiple) entries as child/detail of master table
  3. Detail insert/update/delete form as child of list mentioned in 2)

So he needs two forms?
One for inserting what you manually enter in the text field (master)
And another for MANUALLY entering (using the keyboard) more items for the (details multi insert) ?

What are the table mentioned then? He mentions a details table? Details table means you get the details from a query when you enter something in the text field.

What he needs is:
Two database tables - one table for categories and one for items
Then he needs a master list on the page to show categories and a details list of all the items in a specific (selected) category.
Then per item the possibility to edit/delete that specific item (best practice in my view would be a modal) and the possibility to add an item to the selected category.
That is why I referred to @ben video tutorials (22) as that is very close to what he is looking for. Just read “items” instead of “images” and without the sorting.

But the initial question in the topi mentions INSERT not edit or delete!
That is why i am asking how is the data in the details database table supposed to be inserted? Via form, via another database query - how?

Also i am not asking about the serverside part of the task as i already explained how to do this! My question is - on the page - what do you have on the page where you INSERT the data? HOW do you enter the details for the entered MASTER in the TEXT FIELD?

exactly web-works

So you need two forms?
And the so-called DETAILS table on the page is just a form where you manually enter your detail items related to the master???

yes, for this moment

Oh god, you could have explained that in your first post.
You said you need:

that is not a proper explanation. You just need two forms - one which inserts in the master table and another which makes multiple inserts in the details table!
How should the detail items number be set / how would you like to set how many details items to be inserted for each master record?

That’s the Babylonian confusion on this subject :rofl: :sweat: