Home >Backend Development >PHP Tutorial >thinkphp study notes 2

thinkphp study notes 2

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:14:13987browse

First of all, 3.2.3 database classes and drivers have been rewritten using PDO (Make sure your server environment has PDO extension enabled), so no matter what database it is, it is implemented based on PDO, so DB_TYPE no longer supports PDO Settings must use the actual database type settings, and there is no longer a distinction between mysql and mysqli (just set it to mysql uniformly) The role of the DB_DSN parameter has changed, so it no longer needs to be set by default, just set it to an empty string.

That is to say

The original pdo configuration is

'DB_TYPE'=>'pdo',
'DB_USER'=& gt;'root',
'DB_PWD'=>'111',
'DB_PREFIX'=>'think_',
'DB_DSN'=>'mysql:host=localhost;dbname=thinkphp;charset=UTF8' ,

3.2.3 version of mysql should be changed to the following

'DB_TYPE'=>'mysql',
'DB_USER '=>'root',
'DB_PWD'=>'111',
'DB_PREFIX'=>'think_',
'DB_DSN'=>'mysql:host=localhost;dbname=thinkphp;charset=UTF8',

The above introduces thinkphp study notes 2, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP global keywordNext article:PHP global keyword