2,209
社区成员
发帖
与我相关
我的任务
分享
/**更新某行某列的数据**/
char *sql10="update test_table set age='28',hight='203' where name='ll'";
int tem10=sqlite3_exec(db,sql10,call_back,0,&errmsg);
if(tem10!=SQLITE_OK)
perror("sqlite3_errmsg");
char *sql10="update test_table set age='28',hight='203' where name='ll'";//就是怎么把这里的‘28’和‘203’怎么替换成buff里的内容啊,通过什么途径来来替换,才能让sql执行语句不是像上面不是自己输入进去的那样
)/**更新某行某列的数据**/
char sql11[256];
int updatechar[2]={30,208};
sprintf(sql11,"update test_table set age='%d',hight='%d' where name='ll'",updatechar[0],updatechar[1]);
// printf("%s\n",sql11);
int tem11=sqlite3_exec(db,(const char *)sql11,0,0,&errmsg);
if(tem11!=SQLITE_OK)
perror("sqlite3_errmsg");
但是现在我想知道的是直接简单点的,比喻说SQL语句有么有其他的方法!