summaryrefslogtreecommitdiffstats
path: root/lib/db
diff options
context:
space:
mode:
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/adapter.php3
-rw-r--r--lib/db/adaptersqlite.php4
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/db/adapter.php b/lib/db/adapter.php
index 92c24b46fff..20e7ea4a600 100644
--- a/lib/db/adapter.php
+++ b/lib/db/adapter.php
@@ -38,8 +38,7 @@ class Adapter {
$inserts = array_merge($inserts, $inserts);
try {
- $statement = $this->conn->prepare($query);
- $result = $statement->execute($inserts);
+ $result = $this->conn->executeUpdate($query, $inserts);
} catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query.'<br />';
diff --git a/lib/db/adaptersqlite.php b/lib/db/adaptersqlite.php
index 61cfaa44242..fa6d308ae32 100644
--- a/lib/db/adaptersqlite.php
+++ b/lib/db/adaptersqlite.php
@@ -27,7 +27,7 @@ class AdapterSqlite extends Adapter {
$query = substr($query, 0, strlen($query) - 5);
try {
$stmt = $this->conn->prepare($query);
- $result = $stmt->execute(array($input));
+ $result = $stmt->execute(array_values($input));
} catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />';
@@ -36,7 +36,7 @@ class AdapterSqlite extends Adapter {
\OC_Template::printErrorPage( $entry );
}
- if ($stmt->fetchColumn() === 0) {
+ if ($stmt->fetchColumn() === '0') {
$query = 'INSERT INTO `' . $table . '` (`'
. implode('`,`', array_keys($input)) . '`) VALUES('
. str_repeat('?,', count($input)-1).'? ' . ')';