Added DB

And wrote a test function, however we should use mysqli or pdo instead.