(BOOL) addticket {
NSString *event=@"max";
NSString *venue=@"tvm";
sqlite3 *database;
databaseName = @"smbhDB.sql";
sqlite3_stmt *addStatement ;
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
databasePath = [documentsDir stringByAppendingPathComponent:databaseName];
if(addStatement == nil) {
const char *sql ="insert into tickets (venue, event,) Values (?,?)";
if(sqlite3_prepare_v2(database, sql, -1, &addStatement, NULL) != SQLITE_OK)
NSAssert1(0, @"444 Error while creating add statement. '%s'", sqlite3_errmsg(database));
}
sqlite3_bind_text(addStatement, 1, [venue UTF8String], -1, SQLITE_TRANSIENT);
sqlite3_bind_text(addStatement, 2, [event UTF8String], -1, SQLITE_TRANSIENT);
if(SQLITE_DONE != sqlite3_step(addStatement))
NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
sqlite3_reset(addStatement);
...
This code not working. Please can someone help me to correct it. If anybody can post sample code please upload.