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