开发者

Creating new SQLite DBs with PDO

开发者 https://www.devze.com 2022-12-14 01:03 出处:网络
I want to provide a setup feature in my next project and I\'m wondering if it\'s possible to create a SQLite 3开发者_StackOverflow中文版 database from scratch with PDO or I\'m just stuck at connecting

I want to provide a setup feature in my next project and I'm wondering if it's possible to create a SQLite 3开发者_StackOverflow中文版 database from scratch with PDO or I'm just stuck at connecting to existing databases via DSN?

If it isn't possible with PDO is there any way to create a new DB via PHP?


A new sqlite database is created when you open a connection to one that doesn't exist. You can just check if the file exists, and then if it doesn't, then just create a new database connection and insert the tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消