php - Performing a Mass Equation Update on MySQL Tables -


there thousand ways have seen update rows on table same value, how edit them @ once based on equation?

basically have cron running says every hour run php, php nothing of yet..

i curious how go telling take each row , add field 'money' field 'revenue' , each row individually instead of adding same value of them. curious how go doing that.

(example code welcome lol) have tried few ways nothing seems work, keep getting effect of tables updating same value. when should update relevant each individual rows money , revenue fields.

thanks in advance! ~blake gillman

you need reference rows of table in update onto themselves. like:

update your_table set money = ( ( money + money ) / revenue ) 1; 

this set rows based on values in row itself. example, , can add more complex formulas need. check out math page of mysql docs. luck.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -