function simplenews_subscription_update in Simplenews 7
Same name and namespace in other branches
- 7.2 simplenews.module \simplenews_subscription_update()
Update subscriber objects in the database.
@todo Replace with simplenews_subscription_save() ?
Parameters
$conditions: Array of selection conditions. e.g. array('tid' => 5, 'snid' => 12).
$data: Associative array of database fields to be updated.
Related topics
File
- ./
simplenews.module, line 1476 - Simplenews node handling, sent email, newsletter block and general hooks
Code
function simplenews_subscription_update($conditions = array(), $data) {
$query = db_update('simplenews_subscription');
foreach ($conditions as $key => $condition) {
$query
->condition($key, $condition);
}
$query
->fields($data);
$query
->execute();
}