Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
c4fa07d7
Commit
c4fa07d7
authored
Jul 02, 2014
by
Robin Appelman
Browse files
Also update sqliteadapter
parent
b2001892
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/private/db/adaptersqlite.php
View file @
c4fa07d7
...
...
@@ -21,13 +21,21 @@ class AdapterSqlite extends Adapter {
// NOTE: For SQLite we have to use this clumsy approach
// otherwise all fieldnames used must have a unique key.
$query
=
'SELECT COUNT(*) FROM `'
.
$table
.
'` WHERE '
;
foreach
(
$input
as
$key
=>
$value
)
{
$query
.
=
'`'
.
$key
.
'` = ? AND '
;
$inserts
=
array
();
foreach
(
$input
as
$key
=>
$value
)
{
$query
.
=
'`'
.
$key
.
'`'
;
if
(
is_null
(
$value
))
{
$query
.
=
' IS NULL AND '
;
}
else
{
$inserts
[]
=
$value
;
$query
.
=
' = ? AND '
;
}
}
$query
=
substr
(
$query
,
0
,
strlen
(
$query
)
-
5
);
try
{
$stmt
=
$this
->
conn
->
prepare
(
$query
);
$result
=
$stmt
->
execute
(
array_values
(
$input
)
);
$result
=
$stmt
->
execute
(
$inserts
);
}
catch
(
\
Doctrine\DBAL\DBALException
$e
)
{
$entry
=
'DB Error: "'
.
$e
->
getMessage
()
.
'"<br />'
;
$entry
.
=
'Offending command was: '
.
$query
.
'<br />'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment