Tuesday, February 15, 2022

[FIXED] Data not saving through model in yii2

Issue

I am newbie to the Yii2 framework.

I am creating a custom form and saving its data to a table. I tried every solution that is here or on Google.

I am really getting frustrated. Can anybody solve or give solution to this problem? If you need I can give you the code or access of the site as well.


Solution

You cannot save the data into database using form model

form model just introduced in yii to collect the user data. Later this data will be used and then discarded. It can not save the data into database.

To save the data, you should use Active Records



Answered By - Hearaman

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.