|
@@ -29,9 +29,12 @@ void datado(void) {
|
|
// for now
|
|
// for now
|
|
|
|
|
|
// NEXT!
|
|
// NEXT!
|
|
- char nick[] = "Captain";
|
|
|
|
|
|
+ char nick[] = "captain";
|
|
|
|
+
|
|
|
|
+ // https://stackoverflow.com/questions/973541/how-to-set-sqlite3-to-be-case-insensitive-when-string-comparing#973785
|
|
|
|
+ strcpy(sqlbuffer, "SELECT id FROM USER WHERE nick=? COLLATE NOCASE");
|
|
|
|
+ // captain will now match Captain
|
|
|
|
|
|
- strcpy(sqlbuffer, "SELECT id FROM USER WHERE nick=?");
|
|
|
|
sqlite3_prepare_v2(db, sqlbuffer, strlen(sqlbuffer) + 1, &stmt, NULL);
|
|
sqlite3_prepare_v2(db, sqlbuffer, strlen(sqlbuffer) + 1, &stmt, NULL);
|
|
sqlite3_bind_text(stmt, 1, nick, strlen(nick), SQLITE_STATIC);
|
|
sqlite3_bind_text(stmt, 1, nick, strlen(nick), SQLITE_STATIC);
|
|
rc = sqlite3_step(stmt);
|
|
rc = sqlite3_step(stmt);
|