Implementation of thinkPHP connection to the sqlite3 database (with the Thinkphp code generator download), sqlite3thinkphp

Source: Internet
Author: User

Implementation of thinkPHP connection to the sqlite3 database (with the Thinkphp code generator download), sqlite3thinkphp

This example describes how thinkPHP can connect to the sqlite3 database. We will share this with you for your reference. The details are as follows:

First, check whether the DbPdo. class. php file is in the \ Lib \ Driver \ Db directory under the Thinkphp directory.
If not, go here: http://www.thinkphp.cn/extend/205.html
Then confirm the PHP extension support for sqlite, extension = php_sqlite.dll

Connect to the sqlite3 database:

Add the following configuration to the config. php file:

'Db _ type' => 'pdo', 'db _ DSN '=> 'sqlite: DataBase/DB. db', 'db _ prefix' => 'fish _ ', // database table PREFIX 'db _ charset' => 'utf8 ', // The database encoding uses utf8 'db _ FIELDS_CACHE '=> false by default, // enable field caching

Appendix: Click here for the Thinkphp Code GeneratorDownload from this site.

Directly generate the front and back-end CRUD code snippets. You can also customize code templates as needed to reduce repetitive work. Supports MySQL and sqlite databases to quickly build a project prototype.

PS: We recommend several formatting, beautification, and conversion tools on this site to help you sort out messy code. I believe you can use them in future development:

Php code online formatting and beautification tools:
Http://tools.jb51.net/code/phpformat

Online XML/JSON conversion tools:
Http://tools.jb51.net/code/xmljson

Json code online formatting/beautification/compression/editing/conversion tools:
Http://tools.jb51.net/code/jsoncodeformat

SQL code online formatting and beautification tools:
Http://tools.jb51.net/code/sqlcodeformat

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.