PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 15, 2022

[FIXED] Data not saving through model in yii2

 February 15, 2022     model-view-controller, php, yii, yii2     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing