Skip to main content
replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

I am using following update query,

$db = Mage::getSingleton('core/resource')->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->query($query);

How could I get the affected rows count from the above query?. I have already looked on the How do I get the MySQL affected rows using the Magento resource?How do I get the MySQL affected rows using the Magento resource? - but those not works for me.

Kindly advice me on the above.

I am using following update query,

$db = Mage::getSingleton('core/resource')->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->query($query);

How could I get the affected rows count from the above query?. I have already looked on the How do I get the MySQL affected rows using the Magento resource? - but those not works for me.

Kindly advice me on the above.

I am using following update query,

$db = Mage::getSingleton('core/resource')->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->query($query);

How could I get the affected rows count from the above query?. I have already looked on the How do I get the MySQL affected rows using the Magento resource? - but those not works for me.

Kindly advice me on the above.

Tweeted twitter.com/#!/StackMagento/status/415433276443340800
Source Link

How do I get the MySQL (updated) affected rows when using the Magento resource?

I am using following update query,

$db = Mage::getSingleton('core/resource')->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->query($query);

How could I get the affected rows count from the above query?. I have already looked on the How do I get the MySQL affected rows using the Magento resource? - but those not works for me.

Kindly advice me on the above.