Reference--http://www.cnblogs.com/likebeta/archive/2012/06/17/2552784.html
http://babybandf.blog.163.com/blog/static/61993532010326133751/
Execute SQL statement
Get the result set and store
No callback function
int sqlite3_get_table ( sqlite3 *db,/ * An Open database */ const char *zsql, Char ***pazresult, / * Results of the query */ int *pnrow,/* Number of result rows written here */ int *pncolumn,/* Number of result columns written here * /char **pzerrmsg /* Error msg written here */); void Sqlite3_free_table (char **result);
The 1th argument no longer says more, look at the previous example.
The 2nd parameter is the SQL statement, which is the same as the SQL in Sqlite3_exec. is a very common char* string that ends with a.
The 3rd parameter is the query result, which is still a one-dimensional array (don't think of it as a two-dimensional array, let alone a three-dimensional array). its memory layout is: The field name, followed by the value of each field. here's an example.
The 4th parameter is how many records are queried (that is, how many rows are detected, excluding the row of field names).
The 5th parameter is the number of fields (how many columns).
The 6th parameter is the error message, just like the previous one, here is not much to say.
The number of strings returned by Pazresult is actually (*pnrow+1) * (*pncolumn), because the first (*pncolumn) is the field name
Sqlite-api-sqlite3_get_table ()