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


PHP JDatabaseDriver::select方法代码示例

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


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

示例1: loadDatabase

 /**
  * Allows the application to load a custom or default database driver.
  *
  * @param   JDatabaseDriver  $driver  An optional database driver object. If omitted, the application driver is created.
  *
  * @return  JApplicationBase This method is chainable.
  *
  * @since   12.1
  */
 public function loadDatabase(JDatabaseDriver $driver = null)
 {
     if ($driver === null) {
         $this->db = JDatabaseDriver::getInstance(array('driver' => $this->get('db_driver'), 'host' => $this->get('db_host'), 'user' => $this->get('db_user'), 'password' => $this->get('db_pass'), 'database' => $this->get('db_name'), 'prefix' => $this->get('db_prefix')));
         // Select the database.
         $this->db->select($this->get('db_name'));
     } else {
         $this->db = $driver;
     }
     // Set the database to our static cache.
     JFactory::$database = $this->db;
     return $this;
 }
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:22,代码来源:cli.php

示例2: loadDatabase

 /**
  * Method to create a database driver for the Web application.
  *
  * @return void
  *
  * @since 1.0
  */
 protected function loadDatabase()
 {
     $database = 'sqlite' == $this->get('db_driver') ? APP_PATH_DATA . '/' . $this->get('db_name') : $this->get('db_name');
     $this->db = JDatabaseDriver::getInstance(array('driver' => $this->get('db_driver'), 'host' => $this->get('db_host'), 'user' => $this->get('db_user'), 'password' => $this->get('db_pass'), 'database' => $database, 'prefix' => $this->get('db_prefix')));
     // Select the database.
     if ('sqlite' != $this->get('db_driver')) {
         $this->db->select($this->get('db_name'));
     }
     // Set the debug flag.
     $this->db->setDebug($this->get('debug'));
     // Set the database to our static cache.
     JFactory::$database = $this->db;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:20,代码来源:web.php


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