Implementation method of thinkphp connection Sqlite3 database (with thinkphp code generator download) _php instance

Source: Internet
Author: User
Tags generator php code php template sqlite smarty template

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.

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.