title: Can't delete row from SQLite database in iOS?
body: <p>I am using this code to delete row from Sqlite3 Database,but it's not working,insert,update,select query are working fine, but the delete statement is not working in my code</p>
  
  <pre><code> -(void)delete{
  
          str=title.text;
          sqlite3_stmt *selectstmt;
          if (sqlite3_open([path UTF8String], &amp;database) == SQLITE_OK) {
              NSString *deleteSQL = [NSString stringWithFormat: @"delete from ToDo where title=\"%@\"",str];
              NSLog(@"%@",deleteSQL);
              const char *sql = [deleteSQL UTF8String];
              sqlite3_prepare_v2(database,sql, -1, &amp;selectstmt, NULL); 
              if(sqlite3_prepare_v2(database, sql, -1, &amp;selectstmt, NULL) == SQLITE_OK) 
                 NSLog(@"success");
              else
                NSAssert1(0, @"Error while creating delete statement. '%s'", sqlite3_errmsg(database));            
              }
              sqlite3_finalize(selectstmt);
              sqlite3_close(database);
          }
  </code></pre>
  
  <p>What am I doing wrong?</p>