I have in my Yii connected MySql database a view based on a select statement with sum and group by actions.
This gives a score overview, something like:
Team: Points:
one 30
two 60
How should I proceed to render this MySql-view in my application? Can a Gii generator be usefull? (Model works but Controller, not since no Primary Key, and don’t need CRUD).
Or should I just reproduce the sql-select in a function of the Model?
And last but not least, anyone an idea how to refresh the score-page automatically after x seconds?
You can create a model for a MySQL view by overriding the primaryKey() method. As it seems that your view is not updateable, you won’t be able to save any records.