I'm having some difficulties with Yii.
In my project I have a two fields (and Id_status Artist) it is possible to insert multiple rows like the following example http://www.eha.ee/labs/yiiplay/index.php/en/site/extension?view=dynamicrows
But the problem is that I am not able to save data in the database.
For this case I am working with three tables (tbl_song, tbl_artists, tbl_song_artists).
If anyone can help me thanks.
Yeah this should work. Just use Yii's Tabular Input.
The trick is making sure your JavaScript that is dynamically adding new rows to your Form gives the new text inputs the right
name
andid
, with a unique number.You could probably just use a random number for the $i value, just so long as you use the
[]
syntax Yii will parse the $_POST input as an array which you can loop through in your action on the server, and save each row to the database.I hope this hint helps - good luck!