title: How do I get the MySQL affected rows using the Magento resource?
body: <p>I am using following update query,</p>
  
  <pre><code>$db = Mage::getSingleton('core/resource')-&gt;getConnection('core_write');
  
  $query = UPDATE `catalog_product_entity_decimal` val SET val.value = '11' 
  WHERE val.attribute_id = 75 AND 
  val.entity_id = (select cv.entity_id from `catalog_product_entity` as cv where cv.sku = '25' limit 1)
  
  $afected = $db-&gt;query($query);
  </code></pre>
  
  <p>How could I get the affected rows count from the above query?. I have already looked on the
  <a href="https://magento.stackexchange.com/questions/10623/how-do-i-get-the-mysql-affected-rows-using-the-magento-resource">https://magento.stackexchange.com/questions/10623/how-do-i-get-the-mysql-affected-rows-using-the-magento-resource</a> - but those not works for me.</p>
  
  <p>Kindly advice me on the above.</p>