我编写了一个函数来更新fsize
数据库表中调用的字段,但我的函数不起作用。我不知道为什么。我调试了sqlite的错误代码,0
所以我不知道出了什么问题。
void update_fsize(int asizex, char path[], int sizex) {
char *q;
q="UPDATE search SET ustat=0,fsize=? WHERE fpath=?";
if (sqlite3_prepare_v2(db, q, strlen(q), &pointer, 0) == SQLITE_OK) {
sqlite3_bind_int(pointer, 1, asizex);
sqlite3_bind_text(pointer, 2, path, strlen(path), 0); // file path
sqlite3_step(pointer); // prepare statemnt Ready
sqlite3_finalize(pointer);
}
int ecode = sqlite3_errcode(db);
cout << "\n error code is " << ecode;
cout << "\n\n\n Path: " << path << "\n actual size: " << asizex << "\n Recored size: " << sizex;
}