So, i want to update field name
from account
table.
I function below this function.
but when i test it, it is not work correctly.
sqlite3_step always return SQLITE_BUSY
I do a test and i got database is locked
message.
What should i do?
int c_accountdata::name_set(std::string input)
{
if (input.length() > 20)
{
return -1;
}
sqlite3_bind_text(stmt_name_exist, 1, input.c_str(), -1, NULL);
if (sqlite3_step(stmt_name_exist) == SQLITE_ROW)
{
sqlite3_reset(stmt_name_exist);
return 0;
}
sqlite3_reset(stmt_name_exist);
sqlite3_bind_text(stmt_name_update, 0, input.c_str(), -1, NULL);
sqlite3_bind_text(stmt_name_update, 1, input.c_str(), -1, NULL);
int ret = sqlite3_step(stmt_name_update);
sqlite3_reset(stmt_name_update);
sampgdk::logprintf("%d", ret);
return 1;
}