Call to undefined function db_affected_rows()
As it happens UpdateQuery::execute() returns


  The number of rows affected by the update.


So instead of:

$result = db_update('uc_dependent_attributes')-&gt;fields(array(
  'enabled' =&gt; 0,
))-&gt;condition('nid', $form_state['values']['nid'])-&gt;condition('combination', $value['combo_array'])-&gt;execute();
$affected_rows = $result-&gt;rowCount();
if ($affected_rows!=0) {


use:

...
$affected_rows = db_update('uc_dependent_attributes')
  -&gt;fields(array('enabled' =&gt; 0))
  -&gt;condition('nid', $form_state['values']['nid'])
  -&gt;condition('combination', $value['combo_array'])
  -&gt;execute();

if ($affected_rows == 0) {
...


(there's also a small fix to the conditional logic)