Life Lei Dog thinkphp Project----corporate website 4 database connection

Source: Internet
Author: User

We are well known, we are in the development of the site is the need to connect to our database, after all, the database is one of the core of the site, no nonsense said directly open dry ....

We find: config.php file for her to modify, because we use the database before and after the site, so we directly under the yao\web\common\conf to find the config.php before and after the shared file inside the database configuration can be modified.

The code looks like this:

<?PHPreturn Array(    //' configuration item ' = ' config value '//module (front and back) for access in the system' Module_allow_list ' =Array(' Home ', ' Admin '),//Configure default Access module home' Default_module ' = ' Home ',//default module//prohibit use of PHP code in the template default to False//' tmpl_deny_php ' =>false; Database Configuration' Db_type ' = ' mysql ',//Database Type' db_host ' = ' localhost ',//Server Address' Db_name ' = ' Yao ',//Database name' Db_user ' = ' root ',//User name' Db_pwd ' = ' root ',//Password' Db_port ' = ' 3306 ',//Port' Db_prefix ' = ' jj_ ',//database table Prefixes                /*turn on session switch*/' Session_auto_start ' =true,//whether to open session automatically);

So we can link the database properly.

Life Lei Dog thinkphp Project----corporate website 4 database connection

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.