Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two tables named 'Allrawmaterials' and 'Formulation',in 'Allrawmaterial' table there is field 'rawmaterial',if I update perticular value in field 'rawmaterial', it has to update filed 'raw' in table 'Formulation'.


PHP
  $objdpoddt = Formulation::LoadAll(QQ::OrderBy(QQN::Formulation()->ProductObject->Productnm));
foreach ($objdpoddt as $objdpodd){
                    
$objdpodd->Total= number_format($objformhasallrowmat->ProductionCost, 2, '.', '');
$objdpodd->BasicAmount= number_format((($objdpodd->Total*$objdpodd->Expence)/100)+$objdpodd->Total, 2, '.','');
$objdpodd->Save();
}


I had refreshed the database database,but the effect of changed data is seeing on all the 'rawmaterial' but iI have to update only perticular 'rawmaterial'which had updated in 'Allrawmaterials'.
Posted
Updated 9-Nov-13 19:26pm
v6
Comments
CHill60 9-Nov-13 8:08am    
What do you mean by "not working well" ... what does it do that is different from what you expect?
Graham Breach 10-Nov-13 5:03am    
Are you sure the field is called "Expence" and not "Expense"?

1 solution

you must refresh databse too see added data
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900