This is how we bind sqlite variables by index.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4576 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-10-24 01:27:35 +00:00
parent f6d9d23456
commit 25bc1279c2
5 changed files with 18 additions and 18 deletions

View File

@ -90,7 +90,7 @@ void tf_ssb_export(tf_ssb_t* ssb, const char* key)
sqlite3* db = tf_ssb_acquire_db_reader(ssb);
sqlite3_busy_timeout(db, 10000);
sqlite3_stmt* statement;
if (sqlite3_prepare(db, "SELECT value FROM properties WHERE id = $1 AND key = 'path:' || $2", -1, &statement, NULL) == SQLITE_OK)
if (sqlite3_prepare(db, "SELECT value FROM properties WHERE id = ?1 AND key = 'path:' || ?2", -1, &statement, NULL) == SQLITE_OK)
{
if (sqlite3_bind_text(statement, 1, user, -1, NULL) == SQLITE_OK &&
sqlite3_bind_text(statement, 2, path, -1, NULL) == SQLITE_OK &&