updated database connection

Use static methods in connect to access/update database. there may be
some bugs in the php I've yet to discover. if you get any errors let me
know and ill fix it.