restored missing function and migrated it to new PDO database class, fixes #1306

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