SQLite's official website
http://addons.mozillan.org/firefox/addon/sqlite-manager/
http://www.sqlite.org
Sqlite3 *sqlite = nil;
NSString *filepath = [Nshomedirectory () stringbyappendingpathcomponent:@ "Documents/data.file"];
Open Database
int result = Sqlite3_open ([FilePath utf8string], &sqlite);
if (Result!=sqlite_ok) {
NSLog (@ "Create failed!!! ");
return;
}
To create a table's SQL statement
NSString *sql = @ "CREATE TABLE IF not EXISTS usertable (userName text PRIMARY KEY, password text,email text)";
Execute SQL statement
Char *error;
result = Sqlite3_exec (SQLite, [SQL Utf8string], NULL, NULL, &ERROR);
if (Result! = SQLITE_OK) {
NSLog (@ "Failed to create database:%s", error);
return;
}
Plug in a piece of data
INSERT OR REPLACE into usertable (username,password,email) VALUES (?,?,?);
Update One piece of data
UPDATE usertable Set password = ' where userName = ';
Querying data
SELECT UserName, password,eamil from usertable where userName = ';
Delete data
DELETE from usertable WHERE username = ';
Close the database
Sqlite3_close (SQLite);
SQLite Poor content