mirror of
https://github.com/friendica/friendica
synced 2024-11-10 09:02:53 +00:00
Check before doing the database update
This commit is contained in:
parent
64595e9a2d
commit
5e4a2badb2
1 changed files with 5 additions and 2 deletions
|
@ -1335,9 +1335,12 @@
|
||||||
|
|
||||||
$idlist = implode(",", $idarray);
|
$idlist = implode(",", $idarray);
|
||||||
|
|
||||||
if ($idlist != "")
|
if ($idlist != "") {
|
||||||
$r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` AND `id` IN (%s)", $idlist);
|
$unseen = q("SELECT `id` FROM `item` WHERE `unseen` AND `id` IN (%s)", $idlist);
|
||||||
|
|
||||||
|
if ($unseen)
|
||||||
|
$r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` AND `id` IN (%s)", $idlist);
|
||||||
|
}
|
||||||
|
|
||||||
$data = array('$statuses' => $ret);
|
$data = array('$statuses' => $ret);
|
||||||
switch($type){
|
switch($type){
|
||||||
|
|
Loading…
Reference in a new issue