Working with php to interface with a postgresql database