scw00 2015-04-05 09:29 采纳率: 75%
浏览 2661
已采纳

linux c sqlite 查询语句。。。

我想差做一个用户注册登陆用sqlite3 数据库。
sprintf(sql,"select * from user where name='%s' and passwd='%s'",send->name,send->passwd);
res = sqlite3_exec(db, sql, NULL, NULL, NULL);

怎么判断返回值是否为空。。

res = sqlite3_get_table(db, sql_select, &Result, &Row, &Col, NULL);
if (res == 0){
    for (i=0; i<(Row +1)*Col; i++){
        printf("%s\t", Result[i]);
        if ((i+1)%Col == 0){
            printf("\n");
        }
    }
}
  • 写回答

4条回答 默认 最新

  • oyljerry 2015-04-05 11:06
    关注

    返回值都在roe,col。result等中就是返回数据。你的方法已经可以拿到了。只不过你自己再判断一下具体值

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?