Skip to content

Instantly share code, notes, and snippets.

@nonstriater
Created May 4, 2014 06:03
Show Gist options
  • Save nonstriater/32e3179d5e8d11a5e8cb to your computer and use it in GitHub Desktop.
Save nonstriater/32e3179d5e8d11a5e8cb to your computer and use it in GitHub Desktop.
sqlite3 api使用
if (sqlite3_open([DATABASE UTF8String], &database) == SQLITE_OK)
{
NSString *sql = [NSString stringWithFormat:@"update lpb set %@ = '%@' where level='%@'", self.typeString, self.iconString, self.levelString];
if (sqlite3_exec(database, [sql UTF8String], NULL, NULL, &error) != SQLITE_OK)
NSLog(@"LPBERROR: %@ , %s",sql, error);
sqlite3_close(database);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment