Skip to content
Snippets Groups Projects
Commit f3b9469d authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#638702 by jhodgdon: fix issues where the return value of db_affected_rows()...

#638702 by jhodgdon: fix issues where the return value of db_affected_rows() was not properly considered
parent 6a562f24
No related branches found
No related tags found
No related merge requests found
......@@ -287,7 +287,7 @@ function search_update_totals() {
$total = log10(1 + 1/(max(1, $total)));
db_query("UPDATE {search_total} SET count = %f WHERE word = '%s'", $total, $word);
if (!db_affected_rows()) {
db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %f)", $word, $total);
@db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %f)", $word, $total);
}
}
// Find words that were deleted from search_index, but are still in
......
......@@ -1250,7 +1250,7 @@ function user_set_authmaps($account, $authmaps) {
if ($value) {
db_query("UPDATE {authmap} SET authname = '%s' WHERE uid = %d AND module = '%s'", $value, $account->uid, $module[1]);
if (!db_affected_rows()) {
db_query("INSERT INTO {authmap} (authname, uid, module) VALUES ('%s', %d, '%s')", $value, $account->uid, $module[1]);
@db_query("INSERT INTO {authmap} (authname, uid, module) VALUES ('%s', %d, '%s')", $value, $account->uid, $module[1]);
}
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment