$conn  = Mage::getSingleton('core/resource')->getConnection('core_write');
    $sql = "UPDATE ...";
    $result = $conn->query($sql);

How do I get the number of affected rows - i.e. `mysql_affected_rows();`