如何使用SQLite存储数据?

(1)添加依赖:SQLite动态库


libsqlite3.dylib

(2)导入头文件

import

(3)利用C语言函数创建、打开数据库,编写SQL语句。


sqlite3 *db;
sqlite3_open(<#const char filename#>, &db);
sqlite_3_exec(db, "create table if not exist t_student(id integer , name text, number text);", <#int (
callback)(void *, int, char **, char **)#>, <#void *#>, <#char **errmsg#>);

你可能感兴趣的:(如何使用SQLite存储数据?)