Making select and update in one query
问题 is there a query where I can do both querys in one? This is the first $q = "select c.id as campaignId,c.priceFactor, o.cid,o.bloggerPrice,o.state as state,o.customerPrice,o.id as orderId,o.listPrice,o.basicPrice from campaign c, orders o where c.id={$campaignId} and c.id = o.cid and o.state in (8,9)"; And this is the second foreach($orders as $order) { $listPrice = $order->priceFactor * $order->basicPrice; if($order->bloggerPrice < $listPrice || $order->customerPrice < $listPrice) { $order-