I want to update the quantity if the menuid is already available otherwise add a new row. I used the following code.But no row is added or updated. sqlite3 *database; sqlite3_stmt *addStmt=nil; if (selection== nil) { selection =@"Medium"; } if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { const char *select="select quantity from item where menuid = ?"; sqlite3_stmt *selectstmt; if(sqlite3_prepare_v2(database, select, -1, &selectstmt, NULL) == SQLITE_OK) { while(sqlite3_step(selectstmt) == SQLITE_ROW) { menuID= [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 0)]; char *quant = (char *)sqlite3_column_text(selectstmt,1); quantity=[NSString stringWithUTF8String:(char *)quant]; // [self.ids addObject:menuID]; } sqlite3_reset(selectstmt); ...
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update