How to implement thinkPHP to connect to sqlite3 database (with Thinkphp code generator download), sqlite3thinkphp_PHP tutorial

WBOY
Release: 2016-07-12 08:50:51
Original
1790 people have browsed it

How to implement thinkPHP to connect to sqlite3 database (with Thinkphp code generator download), sqlite3thinkphp

This article describes the simple implementation method of thinkPHP to connect to sqlite3 database. Share it with everyone for your reference, the details are as follows:

First check if there is a DbPdo.class.php file in the LibDriverDb directory under the Thinkphp directory.
If not, go here to download it: http://www.thinkphp.cn/extend/205.html
Then confirm that PHP's extended support for sqlite is turned on, extension=php_sqlite.dll

Connect to sqlite3 database:

Add the following configuration in the config.php file:

'DB_TYPE'    => 'pdo',
'DB_DSN'     => 'sqlite:DataBase/db.db',
'DB_PREFIX'    => 'fish_', // 数据库表前缀
'DB_CHARSET'   => 'utf8', // 数据库编码默认采用utf8
'DB_FIELDS_CACHE'  => false, // 启用字段缓存
Copy after login

Attachment: Click here for Thinkphp code generatorDownload from this site.

Directly generate front-end and back-end CRUD code snippets, and you can also customize code templates as needed to reduce duplication of work. Supports MySQL and sqlite databases to quickly build project prototypes.

PS: Here are several formatting/beautifying/conversion tools recommended on this site to help you sort out the messy code. I believe everyone can use it in future development:

php code online formatting and beautification tool:
http://tools.jb51.net/code/phpformat

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

JSON code online formatting/beautifying/compressing/editing/conversion tool:
http://tools.jb51.net/code/jsoncodeformat

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

Readers who are interested in more thinkPHP-related content can check out the special topics on this site: "Introduction to ThinkPHP Tutorial", "Summary of Common Methods of ThinkPHP", "Summary of Cookie Usage in PHP", "Basic Tutorial for Getting Started with Smarty Templates" and "PHP Template technology summary".

I hope this article will be helpful to everyone’s PHP programming based on the ThinkPHP framework.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1133062.htmlTechArticleHow to implement thinkPHP to connect to sqlite3 database (with Thinkphp code generator download), sqlite3thinkphp This article describes how thinkPHP connects to sqlite3 Simple implementation method of database. Share to...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template