#12156 fix sql error check exists
This commit is contained in:
parent
87e17be084
commit
d34bd3f223
|
@ -676,14 +676,14 @@ function notifications_set_user_label_status($source, $user, $label, $value)
|
|||
return false;
|
||||
}
|
||||
|
||||
$eixsts = db_get_row('tnotification_source_user', 'id_user', $user);
|
||||
if (empty($eixsts['enabled']) && empty($eixsts['also_mail'])) {
|
||||
$exists = db_process_sql(sprintf('SELECT * FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source));
|
||||
if (empty($exists['enabled']) && empty($exists['also_mail'])) {
|
||||
$sql = sprintf('DELETE FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source);
|
||||
db_process_sql($sql);
|
||||
$eixsts = false;
|
||||
$exists = false;
|
||||
}
|
||||
|
||||
if ($eixsts === false) {
|
||||
if ($exists === false) {
|
||||
db_process_sql_insert(
|
||||
'tnotification_source_user',
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue