Fix bind index

This commit is contained in:
Andrew Lalis 2023-07-23 20:02:53 -04:00
parent 0e3881dcac
commit 706624b47b
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ LogEntry[] getRecentLogEntriesByRemoteAddress(string remoteAddress) {
import std.array : Appender, appender; import std.array : Appender, appender;
Database db = Database("logbook.sqlite"); Database db = Database("logbook.sqlite");
Statement stmt = db.prepare("SELECT * FROM log_entry WHERE remote_address = :addr ORDER BY created_at DESC LIMIT 10"); Statement stmt = db.prepare("SELECT * FROM log_entry WHERE remote_address = :addr ORDER BY created_at DESC LIMIT 10");
stmt.bind(0, remoteAddress); stmt.bind(1, remoteAddress);
ResultRange results = stmt.execute(); ResultRange results = stmt.execute();
Appender!(LogEntry[]) app = appender!(LogEntry[])(); Appender!(LogEntry[]) app = appender!(LogEntry[])();
foreach (Row row; results) { foreach (Row row; results) {