Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Cactiverecord->Updateall With A Calulated Field?

$
0
0
Hi folks,

I am currently trying to use CActiveRecord->updateAll to update a calcuated field in a table.

The calculation will look at 'price1' and 'price2', then calculate the % difference between the two and enter the figure into 'percentage_change'.

I have done a thorough search for an answer to this but I cannot seem to find one. Can anyone help?

Also, is the calculation can be done by referencing a custom function which does the calculation rather than using SQL syntax?

Any help would be greatly appreciated!

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>