Unable to update database

前端 未结 2 1883
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-28 03:03

I\'m having trouble updating my database. I believe it\'s due to it possibly being read only, however I am unsure. I created my database in my console, and the code below adds t

2条回答
  •  粉色の甜心
    2021-01-28 03:35

    You are forgeting some code for update statement

    //the binding part is missing in your code , you need to write after Prepare statement.
    
    sqlite3_bind_text(compiledStatement, 1, [string UTF8String], -1, SQLITE_TRANSIENT);
    
    if(SQLITE_DONE != sqlite3_step(compiledStatement))
    NSAssert1(0, @"Error while updating. '%s'", sqlite3_errmsg(database));
    
    sqlite3_reset(compiledStatement);
    

    Via iphonesdkarticles.com.

    This will resolve your error.

提交回复
热议问题