Php framework-is thinkPHP written in DB_DSN in the pdo mode? is it mysql mode if it is not written?

Source: Internet
Author: User
{Code...} if this code is written in this way & #039; DB_DSN & #039;, the PDO connection will be automatically used, and the mysql connection will not be written & #039; DB_DSN & #039? Or are Pdo connections used no matter whether writing or not? Or how to set the connection with other parameters?
'Db _ type' => 'mysql', // Database TYPE 'DB _ user' => 'root', // username 'DB _ pwd' => '123 ', // password 'DB _ prefix' => 'think _ ', // database table PREFIX 'DB _ DSN' => 'MySQL: host = localhost; dbname = thinkphp; charset = utf8 ',//★★Note here.

If 'DB _ DSN 'is written in this way, the PDO connection is automatically used. if 'DB _ DSN' is not written, is the mysql connection?

Or are Pdo connections used no matter whether writing or not?

Or how to set the connection with other parameters?

Reply content:
'Db _ type' => 'mysql', // Database TYPE 'DB _ user' => 'root', // username 'DB _ pwd' => '123 ', // password 'DB _ prefix' => 'think _ ', // database table PREFIX 'DB _ DSN' => 'MySQL: host = localhost; dbname = thinkphp; charset = utf8 ',//★★Note here.

If 'DB _ DSN 'is written in this way, the PDO connection is automatically used. if 'DB _ DSN' is not written, is the mysql connection?

Or are Pdo connections used no matter whether writing or not?

Or how to set the connection with other parameters?

For versions earlier than TP3.2.3, ifDB_TYPEUsePDOType, the database type isDB_DSNDepends on the configuration. 3.2.3 or later versions,DB_DSNThis parameter is automatically set by the system. For version 3.2.3PDOMethod, soDB_TYPEThe actual database type needs to be configured and cannot be setPDOAnd are no longer differentiated.mysqlAndmysqli. Please refer to the document for help

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.