fix sql-error in new code from previous commit

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>