久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      phpcms怎么連接數(shù)據(jù)庫

      phpcms怎么連接數(shù)據(jù)庫

      phpcms怎么連接數(shù)據(jù)庫?

      PHPCMS數(shù)據(jù)庫配置

      數(shù)據(jù)庫配置文件位置:caches/configs/database.php

      我們打開這個(gè)配置文件,加入我們的數(shù)據(jù)庫配置信息。數(shù)據(jù)庫配置信息為二維數(shù)組結(jié)構(gòu),默認(rèn)為default,可以根據(jù)default結(jié)構(gòu)配置多個(gè)數(shù)據(jù)庫鏈接(如:extended_1)

      <?php  return array (    'default' => array (      'hostname' => 'localhost',      'database' => 'phpcms',      'username' => 'admin',      'password' => 'admin',      'tablepre' => 'v9_',      'charset' => 'gbk',      'type' => 'mysql',      'debug' => true,      'pconnect' => 0,      'autoconnect' => 0    ),     /* 以下默認(rèn)不存在 */    'extended_1' => array (      'hostname' => '10.10.125.2',      'database' => 'phpcms',      'username' => 'admin',      'password' => 'admin',      'tablepre' => 'v9_',      'charset' => 'gbk',      'type' => 'mysql',      'debug' => true,      'pconnect' => 0,      'autoconnect' => 0    ),  );  ?>

      根據(jù)您的數(shù)據(jù)庫連接信息修改上面的配置內(nèi)容,修改完成后,保存該數(shù)據(jù)庫配置文件。

      配置好數(shù)據(jù)庫后,可通過下面數(shù)據(jù)庫模型類選擇數(shù)據(jù)庫配置文件,數(shù)據(jù)庫等!

      數(shù)據(jù)庫模型位于:phpcms/model/ 目錄下

      <?php    defined('IN_PHPCMS') or exit('No permission resources.');    pc_base::load_sys_class('model', '', 0);    class test_model extends model {      public function __construct() {      $this->db_config = pc_base::load_config('database');      $this->db_setting = 'default';      $this->table_name = 'test';      parent::__construct();    }   }

      PHP中文網(wǎng),大量的免費(fèi)PHPCMS教程,歡迎在線學(xué)習(xí)!

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)