Onethink Connection Operation SQLite Database

Source: Internet
Author: User
Tags sqlite sqlite database

Go straight to dry: a simple demo

Onthink itself already has a SQLite database driver that does not need to be downloaded

Common the following config file:

' SQLITE ' =

Array

' Db_type ' = ' SQLite ',

DB file name attention is placed under the project root directory

' Db_name ' = Xxx.db ',

' Db_charset ' = ' UTF8 ',

' Db_prefix ' = ',

' Db_fields_cache ' = False,

),

model:TestModel.class.php

namespace Admin\model;

Use Think\model;

Class Testmodel extends model{

To join a table name

protected $trueTableName = ' resdata ';

Configuration information for the connection

protected $connection = ' SQLITE ';

}

Controller

$test = D (' test ');

And then we can do the pruning and checking.

Onethink Connection Operation SQLite Database

Related Article

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.