当前位置: 首页>>代码示例>>PHP>>正文


PHP Dba::query方法代码示例

本文整理汇总了PHP中Dba::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Dba::query方法的具体用法?PHP Dba::query怎么用?PHP Dba::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dba的用法示例。


在下文中一共展示了Dba::query方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uninstall

 /**
  * uninstall
  * This removes the remote catalog
  */
 public function uninstall()
 {
     $sql = "DELETE FROM `catalog` WHERE `catalog_type` = ?";
     Dba::query($sql, array($this->get_type()));
     $sql = "DROP TABLE `catalog_" . $this->get_type() . "`";
     Dba::query($sql);
     return true;
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:12,代码来源:catalog.class.php

示例2: get_instance

 /**
  * get_instance
  * This returns a single instance and all it's variables
  */
 public function get_instance($instance = '')
 {
     $instance = $instance ? $instance : AmpConfig::get('vlc_active');
     $sql = "SELECT * FROM `localplay_vlc` WHERE `id` = ?";
     $db_results = Dba::query($sql, array($instance));
     $row = Dba::fetch_assoc($db_results);
     return $row;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:12,代码来源:vlc.controller.php

示例3: install

 /**
  * install
  * This function installs the local catalog
  */
 public function install()
 {
     $sql = "CREATE TABLE `catalog_local` (`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , " . "`path` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , " . "`catalog_id` INT( 11 ) NOT NULL" . ") ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
     $db_results = Dba::query($sql);
     return true;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:10,代码来源:local.catalog.php

示例4: sort_tracks

 /**
  * Sort the tracks and save the new position
  */
 public function sort_tracks()
 {
     /* First get all of the songs in order of their tracks */
     $sql = "SELECT A.`id`\n                FROM `playlist_data` AS A\n           LEFT JOIN `song` AS B ON A.object_id = B.id\n           LEFT JOIN `artist` AS C ON B.artist = C.id\n           LEFT JOIN `album` AS D ON B.album = D.id\n               WHERE A.`playlist` = ?\n            ORDER BY C.`name` ASC,\n                     B.`title` ASC,\n                     D.`year` ASC,\n                     D.`name` ASC,\n                     B.`track` ASC";
     $db_results = Dba::query($sql, array($this->id));
     $i = 1;
     $results = array();
     while ($r = Dba::fetch_assoc($db_results)) {
         $new_data = array();
         $new_data['id'] = $r['id'];
         $new_data['track'] = $i;
         $results[] = $new_data;
         $i++;
     }
     // end while results
     foreach ($results as $data) {
         $sql = "UPDATE `playlist_data` SET `track` = ? WHERE `id` = ?";
         Dba::write($sql, array($data['track'], $data['id']));
     }
     // foreach re-ordered results
     return true;
 }
开发者ID:nioc,项目名称:ampache,代码行数:25,代码来源:playlist.class.php

示例5: install

 /**
  * install
  * This function installs the remote catalog
  */
 public function install()
 {
     $sql = "CREATE TABLE `catalog_dropbox` (`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , " . "`apikey` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , " . "`secret` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , " . "`path` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , " . "`authtoken` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , " . "`getchunk` TINYINT(1) NOT NULL, " . "`catalog_id` INT( 11 ) NOT NULL" . ") ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
     $db_results = Dba::query($sql);
     return true;
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:10,代码来源:dropbox.catalog.php


注:本文中的Dba::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。