Skip to content

Instantly share code, notes, and snippets.

@shnhrrsn
Created March 10, 2012 19:59
Show Gist options
  • Save shnhrrsn/2012757 to your computer and use it in GitHub Desktop.
Save shnhrrsn/2012757 to your computer and use it in GitHub Desktop.
EGODatabase* database = [EGODatabase databaseWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database.db"]];
EGODatabaseResult* result = [database executeQuery:@"SELECT * FROM `posts` WHERE `post_user_id` = ?", [NSNumber numberWithInt:10]];
for(EGODatabaseRow* row in result) {
NSLog(@"Subject: %@", [row stringForColumn:@"post_subject"]);
NSLog(@"Date: %@", [row dateForColumn:@"post_date"]);
NSLog(@"Views: %d", [row intForColumn:@"post_views"]);
NSLog(@"Message: %@", [row stringForColumn:@"post_message"]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment