So i want to save slider_id and banner_id on muffin_bannerslider table with the purpose of tracking which slider belong to which banner and the position of the banner in a particular slider. But that table doesn't belong to any model then how should i do it . Also sorry if this topic already answered but Eng isn't my first language so to type the problem correctly to find the answer can be hard sometimes.
Solved! Go to Solution.
Hi @Thaimeotsv57d7 ,
Please refer https://www.mageplaza.com/magento-2-module-development/how-to-create-crud-model-magento-2.html#step-...
You can refer from Step 2.
Or if you don't want to create model or dont want to follow Magento way then you can use sql queries like https://meetanshi.com/blog/run-direct-sql-query-in-magento-2/
But I am suggesting to follow default magento flow. Direct sql is not recommended.
Problem Solved? Accept as Solution!
Hope it helps!
Thanks
Hi @Thaimeotsv57d7 ,
Please refer https://www.mageplaza.com/magento-2-module-development/how-to-create-crud-model-magento-2.html#step-...
You can refer from Step 2.
Or if you don't want to create model or dont want to follow Magento way then you can use sql queries like https://meetanshi.com/blog/run-direct-sql-query-in-magento-2/
But I am suggesting to follow default magento flow. Direct sql is not recommended.
Problem Solved? Accept as Solution!
Hope it helps!
Thanks
The thing is that table use composite primary key and magento 2 doesn't support it in model that's why i have to look for another solution.