This paper illustrates the simple implementation method of thinkphp connection Sqlite3 database. Share to everyone for your reference, specific as follows:
First check the thinkphp directory in the \lib\driver\db directory there is no DbPdo.class.php this file.
If not, go down here: http://www.thinkphp.cn/extend/205.html
Then confirm that the PHP Extended support for SQLite is turned on, Extension=php_sqlite.dll
To 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 ',//Database encoding defaults to UTF8
' Db_fields_cache ' => false,//enable field caching
attached: thinkphp code generator click here Download the site .
Directly generate the front and back of the CRUD code fragment, you can customize the code template to reduce duplication of labor. Support MySQL and SQLite databases to quickly build project prototypes.
PS: Here recommend a few of the site's format/landscaping/conversion tools to help you organize the messy code, I believe that we can use in future development:
PHP code online format Landscaping tools:
Http://tools.jb51.net/code/phpformat
Online Xml/json Mutual Conversion tool:
Http://tools.jb51.net/code/xmljson
JSON code online Format/beautify/compress/edit/Convert tools:
Http://tools.jb51.net/code/jsoncodeformat
SQL code Online formatting Landscaping tools:
Http://tools.jb51.net/code/sqlcodeformat
More interested in thinkphp related content readers can view the site topics: "thinkphp Introductory Course", "thinkphp Common Methods Summary", "PHP Cookie Usage Summary", "Smarty Template Introductory Course" and "PHP template technology Summary."
I hope this article will help you with the PHP program design based on thinkphp framework.