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");
        }
    }
}

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

select count (*) from user where ...
返回0就是没有

用sqlite3_get_table

http://blog.csdn.net/kid_u_forfun/article/details/7972993