in reply to Does Vroom know about this?

I think the real problem is that the code doesn't check that the database connection succeeded, which is why it ends up calling prepare on an undefined value. :)

Remember, always check the return value of system calls!