#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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$eixsts = db_get_row('tnotification_source_user', 'id_user', $user);
|
$exists = db_process_sql(sprintf('SELECT * FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source));
|
||||||
if (empty($eixsts['enabled']) && empty($eixsts['also_mail'])) {
|
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);
|
$sql = sprintf('DELETE FROM tnotification_source_user WHERE id_user = "%s" AND id_source = "%s"', $user, $source);
|
||||||
db_process_sql($sql);
|
db_process_sql($sql);
|
||||||
$eixsts = false;
|
$exists = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($eixsts === false) {
|
if ($exists === false) {
|
||||||
db_process_sql_insert(
|
db_process_sql_insert(
|
||||||
'tnotification_source_user',
|
'tnotification_source_user',
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue