From 96cb5a3d2e88c7ddab23aa799526d8ab687477c8 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 Apr 2011 17:45:41 +0200 Subject: [PATCH] fix oc_appconfig for sqlite --- lib/appconfig.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/appconfig.php b/lib/appconfig.php index df338a412d..f7c49ca19c 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -47,7 +47,7 @@ class OC_APPCONFIG{ */ public static function getApps(){ // No magic in here! - $query = OC_DB::prepare( 'SELECT DISTINCT( `appid` ) FROM `*PREFIX*appconfig`' ); + $query = OC_DB::prepare( 'SELECT DISTINCT( appid ) FROM `*PREFIX*appconfig`' ); $result = $query->execute(); $apps = array(); @@ -68,7 +68,7 @@ class OC_APPCONFIG{ */ public static function getKeys( $app ){ // No magic in here as well - $query = OC_DB::prepare( 'SELECT `key` FROM `*PREFIX*appconfig` WHERE `appid` = ?' ); + $query = OC_DB::prepare( 'SELECT key FROM `*PREFIX*appconfig` WHERE `appid` = ?' ); $result = $query->execute( array( $app )); $keys = array(); @@ -91,7 +91,7 @@ class OC_APPCONFIG{ */ public static function getValue( $app, $key, $default = null ){ // At least some magic in here :-) - $query = OC_DB::prepare( 'SELECT `value` FROM `*PREFIX*appconfig` WHERE `appid` = ? AND `key` = ?' ); + $query = OC_DB::prepare( 'SELECT value FROM *PREFIX*appconfig WHERE appid = ? AND key = ?' ); $result = $query->execute( array( $app, $key )); if( !$result->numRows()){ @@ -118,11 +118,11 @@ class OC_APPCONFIG{ // null: does not exist if( is_null( $exists )){ - $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*appconfig` ( `appid`, `key`, `value` ) VALUES( ?, ?, ? )' ); + $query = OC_DB::prepare( 'INSERT INTO *PREFIX*appconfig ( `appid`, `key`, `value` ) VALUES( ?, ?, ? )' ); $query->execute( array( $app, $key, $value )); } else{ - $query = OC_DB::prepare( 'UPDATE `*PREFIX*appconfig` SET `value` = ? WHERE `appid` = ? AND `key` = ?' ); + $query = OC_DB::prepare( 'UPDATE *PREFIX*appconfig SET value = ? WHERE appid = ? AND key = ?' ); $query->execute( array( $value, $app, $key )); } }