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