This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

garden
garden

Greetings,

I am using builder plugin to create forms to store data into database. By default, each model belongs to a single database table. And a form can store the data into a single database table. So how to Insert data into 2 different tables captured from a single form using Builder Plugin.

Regards

Shantarli
Shantarli

garden said:

Greetings,

I am using builder plugin to create forms to store data into database. By default, each model belongs to a single database table. And a form can store the data into a single database table. So how to Insert data into 2 different tables captured from a single form using Builder Plugin.

Regards

Hi. You need to use an event function(beforeSave for ex.) in your model: https://octobercms.com/docs/database/model#events

Inside this function you can do everything you want. https://octobercms.com/docs/database/query#inserts

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.