diff options
-rw-r--r-- | sd-add.fish | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sd-add.fish b/sd-add.fish index 1b580a6..69bb353 100644 --- a/sd-add.fish +++ b/sd-add.fish @@ -1,5 +1,5 @@ function sd-add set cardfile cards - set idx (math 1+(sqlite3 "$cardfile" "select max(idx) from cards")) - sqlite3 "$cardfile" "insert into cards values ($idx, 256, '$argv[1]', '$argv[2]')" + set idx (math 1+(sqlite3 "$cardfile" "SELECT MAX(idx) FROM cards")) + sqlite3 "$cardfile" "INSERT INTO cards VALUES ($idx, 256, '$argv[1]', '$argv[2]')" end |