Bugfix

Fixed an error with an undeclared $db variable.