aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOSQLite.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-03 22:48:29 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-07-03 22:48:29 +0200
commitb34f59e85aa851b82210fdc50074918034f960db (patch)
treeab7dcdb13d84454c8a6848a8ea91f293f4d3a1d7 /app/Models/EntryDAOSQLite.php
parent2501bb337e75c41f97570f25775e20131faf2f2a (diff)
Preparation #3 for SQLite
https://github.com/marienfressinaud/FreshRSS/issues/100
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
-rw-r--r--app/Models/EntryDAOSQLite.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 45d3a3ea9..0a837b3aa 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -13,24 +13,24 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
}
} else {
$this->bd->beginTransaction();
- $sql = 'UPDATE `' . $this->prefix . 'entry` e SET e.is_read = ? WHERE e.id=? AND e.is_read<>?';
+ $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=? WHERE id=? AND is_read<>?';
$values = array($is_read ? 1 : 0, $ids, $is_read ? 1 : 0);
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute ($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::record('SQL error markRead 1: ' . $info[2], Minz_Log::ERROR);
$this->bd->rollBack ();
return false;
}
$affected = $stm->rowCount();
if ($affected > 0) {
- $sql = 'UPDATE `' . $this->prefix . 'feed` f SET f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 '
- . 'WHERE f.id=(SELECT e.id_feed FROM `' . $this->prefix . 'entry` e WHERE e.id=?)';
+ $sql = 'UPDATE `' . $this->prefix . 'feed` SET cache_nbUnreads=cache_nbUnreads' . ($is_read ? '-' : '+') . '1 '
+ . 'WHERE id=(SELECT e.id_feed FROM `' . $this->prefix . 'entry` e WHERE e.id=?)';
$values = array($ids);
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute ($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::record('SQL error markRead 2: ' . $info[2], Minz_Log::ERROR);
$this->bd->rollBack ();
return false;
}