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/migrate.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/migrate.php')
-rw-r--r-- | apps/contacts/appinfo/migrate.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/contacts/appinfo/migrate.php b/apps/contacts/appinfo/migrate.php index 2559b4ea456..19c960c75a4 100644 --- a/apps/contacts/appinfo/migrate.php +++ b/apps/contacts/appinfo/migrate.php @@ -34,12 +34,12 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{ switch( $this->appinfo->version ) { default: // All versions of the app have had the same db structure, so all can use the same import function - $query = $this->content->prepare( "SELECT * FROM contacts_addressbooks WHERE userid LIKE ?" ); + $query = $this->content->prepare( 'SELECT * FROM `contacts_addressbooks` WHERE `userid` LIKE ?' ); $results = $query->execute( array( $this->olduid ) ); $idmap = array(); while( $row = $results->fetchRow() ) { // Import each addressbook - $addressbookquery = OCP\DB::prepare( "INSERT INTO *PREFIX*contacts_addressbooks (`userid`, `displayname`, `uri`, `description`, `ctag`) VALUES (?, ?, ?, ?, ?)" ); + $addressbookquery = OCP\DB::prepare( 'INSERT INTO `*PREFIX*contacts_addressbooks` (`userid`, `displayname`, `uri`, `description`, `ctag`) VALUES (?, ?, ?, ?, ?)' ); $addressbookquery->execute( array( $this->uid, $row['displayname'], $row['uri'], $row['description'], $row['ctag'] ) ); // Map the id $idmap[$row['id']] = OCP\DB::insertid('*PREFIX*contacts_addressbooks'); @@ -49,11 +49,11 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{ // Now tags foreach($idmap as $oldid => $newid) { - $query = $this->content->prepare( "SELECT * FROM contacts_cards WHERE addressbookid LIKE ?" ); + $query = $this->content->prepare( 'SELECT * FROM `contacts_cards` WHERE `addressbookid` LIKE ?' ); $results = $query->execute( array( $oldid ) ); while( $row = $results->fetchRow() ){ // Import the contacts - $contactquery = OCP\DB::prepare( "INSERT INTO *PREFIX*contacts_cards (`addressbookid`, `fullname`, `carddata`, `uri`, `lastmodified`) VALUES (?, ?, ?, ?, ?)" ); + $contactquery = OCP\DB::prepare( 'INSERT INTO `*PREFIX*contacts_cards` (`addressbookid`, `fullname`, `carddata`, `uri`, `lastmodified`) VALUES (?, ?, ?, ?, ?)' ); $contactquery->execute( array( $newid, $row['fullname'], $row['carddata'], $row['uri'], $row['lastmodified'] ) ); } } |