Skip to content

Commit

Permalink
Fix update method for same data
Browse files Browse the repository at this point in the history
  • Loading branch information
joykumarbera committed Feb 1, 2023
1 parent a6140e7 commit 296ae57
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,7 @@ public function update($table, $data = [], $conditions = [], $glue = 'AND')
$sql = "UPDATE $table SET $update_columns WHERE $where_clause";
$final_params = array_merge( array_values($data), array_values($conditions));

if( $this->_runQuery($sql, $final_params) ) {
return $this->getAffectedRows();
}

return false;
$this->_runQuery($sql, $final_params);
}

/**
Expand Down Expand Up @@ -454,4 +450,4 @@ public function end_transaction()
throw new DbErrorException($e->getMessage());
}
}
}
}

0 comments on commit 296ae57

Please sign in to comment.