diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-08-25 01:52:27 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-08-25 01:52:27 +0200 |
commit | fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b (patch) | |
tree | 7b3a6c1b946273ee0f1f3f6ade1f9cd3483004dc /apps/contacts/appinfo/update.php | |
parent | fd5af9aff4245127f32f3b90dbd6e52792984447 (diff) | |
download | nextcloud-server-fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b.tar.gz nextcloud-server-fa3497f6ed54b6de16dc44ae94721f00b5d5fc6b.zip |
add backticks to SQL, use limit parameter instead of LIMIT SQL
Diffstat (limited to 'apps/contacts/appinfo/update.php')
-rw-r--r-- | apps/contacts/appinfo/update.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/contacts/appinfo/update.php b/apps/contacts/appinfo/update.php index 21e736bb446..cc00b325e14 100644 --- a/apps/contacts/appinfo/update.php +++ b/apps/contacts/appinfo/update.php @@ -3,15 +3,15 @@ $installedVersion=OCP\Config::getAppValue('contacts', 'installed_version'); if (version_compare($installedVersion, '0.2.3', '<')) { // First set all address books in-active. - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_addressbooks SET active=0' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*contacts_addressbooks` SET `active`=0' ); $result = $stmt->execute(array()); // Then get all the active address books. - $stmt = OCP\DB::prepare( 'SELECT userid,configvalue FROM *PREFIX*preferences WHERE appid=\'contacts\' AND configkey=\'openaddressbooks\'' ); + $stmt = OCP\DB::prepare( 'SELECT `userid`,`configvalue` FROM `*PREFIX*preferences` WHERE `appid`=\'contacts\' AND `configkey`=\'openaddressbooks\'' ); $result = $stmt->execute(array()); // Prepare statement for updating the new 'active' field. - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_addressbooks SET active=? WHERE id=? AND userid=?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*contacts_addressbooks` SET `active`=? WHERE `id`=? AND `userid`=?' ); while( $row = $result->fetchRow()) { $ids = explode(';', $row['configvalue']); foreach($ids as $id) { @@ -20,6 +20,6 @@ if (version_compare($installedVersion, '0.2.3', '<')) { } // Remove the old preferences. - $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*preferences WHERE appid=\'contacts\' AND configkey=\'openaddressbooks\'' ); + $stmt = OCP\DB::prepare( 'DELETE FROM `*PREFIX*preferences` WHERE `appid`=\'contacts\' AND `configkey`=\'openaddressbooks\'' ); $result = $stmt->execute(array()); } |