Note that there are some explanatory texts on larger screens.

plurals
  1. POInsert data in sqlite table dynamically not working
    primarykey
    data
    text
    <p>I want to insert the data in a SQLite table login when a button is clicked, the problem is that when I click on the register button data is getting stored in variable but not in database table, and When I try to statically pass the value the data will be insert but When i trying to dynamically store data then not work.</p> <p>Here is my code. Please go through it and help to solve this issue.</p> <pre><code>NSString *path; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask ,YES); path = [paths objectAtIndex:0]; dbName = [[NSString alloc] initWithString:[path stringByAppendingPathComponent:@"mnc.sqlite"]]; NSFileManager *fileMgr = [NSFileManager defaultManager]; if([fileMgr fileExistsAtPath:dbName]== NO) { const char *dbPath = [dbName UTF8String]; if (sqlite3_open(dbPath,&amp;connectionDB)==SQLITE_OK) { char *errMsg; const char *sql_stmt = " create table if not exists login(user_name text ,password text)"; if (sqlite3_exec(connectionDB,sql_stmt,NULL,NULL,&amp;errMsg)) { printf("\n fail to create table "); } sqlite3_close(connectionDB); } else { NSLog(@"fail to open create database"); } } [fileMgr release]; if(sqlite3_prepare_v2(connectionDB, query ,-1, &amp;statment,NULL) == SQLITE_OK) { sqlite3_bind_text(statment,1,"cc", -1,SQLITE_TRANSIENT); sqlite3_bind_text(statment,2,"sa",-1,SQLITE_TRANSIENT); NSLog(@"aadd"); } if (sqlite3_step(statment)== SQLITE_DONE) { NSLog(@"This should be real error checking!"); sqlite3_finalize(statment); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload