Until the official announcement of the connection settings of sqlite is made, just make do with it
I hope the official can announce the database connection settings and instructions of sqlite
1. First design the sqlite database file pre.db and put it in application/db
2. Add the database.php file under the module and set it as followsreturn [<br>
'type' => 'sqlite',<br>
//'hostname' => ROOT_PATH.'db/pre.db',<br>
'database' => 'pre',<br>
'username' => '',<br>
'password' => '',<br>
'hostport' => '',<br>
'dsn' => 'sqlite:'.ROOT_PATH.'db/pre.db',<br>
'params' => [],<br>
'charset' => 'utf8',<br>
'prefix' => 'yse_',<br>
'debug' => true,<br>
'deploy' => 0,<br>
'rw_separate' => false,<br>
'master_num' => 1,<br>
'slave_no' => '',<br>
'fields_strict' => true,<br>
'resultset_type' => 'array',<br>
'auto_timestamp' => false,<br>
'sql_explain' => false,<br>
];
3. Create model model/User.php as followsnamespace appindexmodel;<br>
use thinkModel;<br>
<br>
class User extends Model{<br>
<br>
}
4. The new operations are as follows public function index(){<br>
echo 'this is pre/index';<br>
<br>
$user = model('User');<br>
<br>
echo 'row:';<br>
$row = $user->get(1);<br>
dump($row);<br>
dump($row->user_id);<br>
dump($row['user_id']);<br>
} }
The attachment is a database
pre.db.zip
( 464 B downloads: 0 times )

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Notepad++7.3.1
Easy-to-use and free code editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
