php functions to connect and perform actions on the database