Sql Query String Functions In Php