Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7549527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:57:58+00:00 2026-05-30T09:57:58+00:00

When I try to delete a row from my iphone app,I could correctly fetch

  • 0

When I try to delete a row from my iphone app,I could correctly fetch the id but the row is not deleting.

-(void)delete_profile:(NSString *)mID {

    NSLog(@"menuID: %@",mID);
    sqlite3 *database;
    sqlite3_stmt *deleteStmt=nil;
    if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
    if(deleteStmt == nil) {
        const char *sql = "delete from item where menuid = ?";
        if(sqlite3_prepare_v2(database, sql, -1, &deleteStmt, NULL) != SQLITE_OK)
            NSAssert1(0, @"Error while creating delete statement. '%s'", sqlite3_errmsg(database));
    }

    //When binding parameters, index starts from 1 and not zero.
    sqlite3_bind_int(deleteStmt, 1, [mID integerValue]);

    if (SQLITE_DONE != sqlite3_step(deleteStmt)) 
        NSAssert1(0, @"Error while deleting. '%s'", sqlite3_errmsg(database));

    sqlite3_reset(deleteStmt);    
    }
    sqlite3_close(database);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:57:59+00:00Added an answer on May 30, 2026 at 9:57 am

    Please check your menuid Datatype . and bind before prepare or use like below example

    if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
    
       NSString *sql = [NSString stringWithFormat:@"delete from item where menuid =%d",[mID intValue]];
    
                    const char *del_stmt = [sql UTF8String];
    
                    sqlite3_prepare_v2(contactDB, del_stmt, -1, & deleteStmt, NULL);
                    if (sqlite3_step(deleteStmt) == SQLITE_DONE)
                    {
    
                    } else {
    
                    }
                    sqlite3_finalize(deleteStmt);
                    sqlite3_close(contactDB);
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Through CommandName=Delete I try to delete a line from the ListView control but not
How delete row from table with help jackcess? I try so, but it's bad:
friends, i am trying to delete row and then when i try to fetch
I simply try to delete a row from a UITableView with the following code:
i can not delete this lines from DB becouse of Unclosed quotation marks. How
I'm trying to delete a row from my table view and so far have
i was write the method to delete row....but, i don't know why, i can't
I am not able to delete data from SQlite database. I have created a
I'm trying to delete one row of data from a MySQL database (innodb) in
Hello guys i`m trying to delete a row in a access database but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.