當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。