Configuring links to multiple databases in tp3.2

Source: Internet
Author: User

config.php

<?php
return Array(
  //'Configuration Items' = 'Configuration Values'

  //Cache
  //' data_cache_type ' = ' Memcache ',
//' memcache_host ' = ' tcp://192.168.0.227:11211 ',
//' data_cache_time ' = ' 3600 ',

  ' Default_controller '=' Index ', // Default controller name
  ' Default_action '=' index ', // Default action Name

  //Database ConfigurationBeruiuser
  ' DB_CONFIG1 '=Array(
     ' Db_type '=' MySQL ',
     ' Db_user '=' Root ',
     ' Db_pwd '=' aisijkl81 ',
     ' Db_host '=' 192.168.0.111 ',
     ' Db_port '=' 3306 ',
     ' db_name '=' 2222 ',
  ),//There are cross-library operations inside

  //Database ConfigurationBr_esfmanager
  ' Db_config2 '=Array(
     ' Db_type '=' MySQL ',
     ' Db_user '=' Root ',
     ' Db_pwd '=' aisijkl8*1 ',
     ' Db_host '=' 1111111 ',
     ' Db_port '=' 3306 ',
     ' db_name '=' 444 ',
  ),//There are cross-library operations inside

  ' domain '=' demo ',//this should be done after the onlineAPI

Used in the Code

$data =m ()->db (2, "Db_config2")->table ("Mn_r_house_web")->where ($where)->find ();


This article is from the "php/[email protected]" blog, be sure to keep this source http://liang3391.blog.51cto.com/178205/1909253

Configuring links to multiple databases in tp3.2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.