query($query); $koszt=15.4; while($dane= $db->fetchByAssoc($res)){ $query2="select c.quantity from ecmproductcomponents c inner join ecmproducts p on p.id=c.ecmcomponent_id inner join ecmproductcategories_bean c2 on c2.bean_id=c.ecmcomponent_id where c.deleted=0 and c.ecmproduct_id='".$dane['product_id']."' and c2.ecmproductcategory_id='d7f876b0-1a3d-43a1-7c9b-511ba40df3d1'"; $res2=$db->query($query2); $total_koszt=0; while($dane2=$db->fetchByAssoc($res2)){ $total_koszt=$total_koszt+($dane['quantity']*$dane2['quantity']*$koszt); } $query3="update ecmstockoperations set work_price=$total_koszt where id='".$dane['id']."'"; $db->query($query3); } */ ?>