generalize database connectivity for different tables, add insertion of user post