Fixed the database wrapper. Should work now through ->db->query(). Connection settings are in libs/config.php