1. Open the Database
int Sqlite3_open (
const char *filename,//file path for database
Sqlite3 **ppdb//DB instance
);
2. Execute any SQL statement
int Sqlite3_exec (
sqlite3*,//an open DB instance
const char *sql,//SQL statement to execute
Int (*callback) (void*,int,char**,char**),//callback after the SQL statement is executed
void *,//The 1th parameter of the callback function
Char **errmsg//error message
);
3. Check the legality of the SQL statement (pre-query preparation)
int Sqlite3_prepare_v2 (
Sqlite3 *db,//DB instance
const char *zsql,//SQL statement to check
int Nbyte,//maximum byte length for SQL statements
Sqlite3_stmt **ppstmt,//sqlite3_stmt instance, used to obtain database data
const CHAR **pztail
);
4. Querying a row of data
int Sqlite3_step (sqlite3_stmt*);//If a row of data is queried, it returns Sqlite_row
5. Use stmt to get the value of a field (the subscript of a field starts with 0)
Double sqlite3_column_double (sqlite3_stmt*, int icol); Floating point data
int Sqlite3_column_int (sqlite3_stmt*, int icol); Integral type data
Sqlite3_int64 Sqlite3_column_int64 (sqlite3_stmt*, int icol); Long-integer data
const void *sqlite3_column_blob (sqlite3_stmt*, int icol); Binary Text data
Const unsigned char *sqlite3_column_text (sqlite3_stmt*, int icol); String data