How to print a single row from table of SQLite database in a C program -


i have used code retrieve row table giving me unknown error.

void retrievedata(sqlite3 *db) {     sqlite3_stmt *stmt;     int rc,retrieve_id;     char *sql;     char *zerrmsg = 0;     const char* data = "callback function called";      printf("please enter employee id:");     scanf("%d",&retrieve_id);      sqlite3_prepare(db,"select name, salary, age, phoneno data id = ?;", -1, &stmt, null);      sqlite3_bind_int(stmt,1,retrieve_id);      rc = sqlite3_step(stmt);     if(rc != sqlite_done)     {         printf("error in retrieving data table:%s\n",sqlite3_errmsg(db));         return;     }     else     {         printf("data retrieved successfully\n");     }     sqlite3_finalize(stmt); } 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -