Converted to php

database connection